Skip to content
linux-system-rolesPublic

About

An ansible role which configures kdump

Resources

Contributing

Stars

19 stars

Watchers

7 watching

Forks

Latest commit

 

History

353 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Role: Kernel Crash Dump

citest.yml

An ansible role which configures kdump.

Warning

The role replaces the kdump configuration of the managed host. Previous settings will be lost, even if they are not specified in the role variables. Currently, this includes replacing at least the following configuration file:

  • /etc/kdump.conf (RedHat like OS)
  • /etc/default/kdump-tools (Ubuntu only, for now)
  • /etc/sysconfig/kdump (SUSE)

Requirements

See below

Collection requirements

The role requires external collections only for management of rpm-ostree nodes. Please run the following command to install them if you need to manage rpm-ostree nodes:

ansible-galaxy collection install -vv -r meta/collection-requirements.yml

Role Variables

kdump_target: Can be specified to write vmcore to a location that is not in the root file system. If type is raw or a filesystem type, location points to a partition (by device node name, label, or uuid). For example:

kdump_target:
  type: raw
  location: /dev/sda1

or for an ext4 filesystem:

kdump_target:
  type: ext4
  location: "12e3e25f-534e-4007-a40c-e7e080a933ad"

If type is ssh, location points to a server: example:

  type: ssh
  location: user@example.com

Similarly for nfs, location points to an nfs server:

  type: nfs
  location: nfs.example.com

Only the ssh type is considered stable, support for the other types is experimental.

kdump_path: The path to which vmcore will be written. If kdump_target is not null, path is relative to that dump target. Otherwise, it must be an absolute path in the root file system.

kdump_core_collector: A command to copy the vmcore. If null, uses makedumpfile with options depending on the kdump_target.type.

kdump_system_action: The action that is performed when dumping the core file fails. Can be reboot, halt, poweroff, or shell.

kdump_auto_reset_crashkernel: Whether to reset kernel crashkernel to new default value or not when kexec-tools updates the default crashkernel value and existing kernels using the old default kernel crashkernel value.

kdump_dracut_args: Pass extra dracut options when rebuilding kdump initrd.

kdump_sysconfig: Extra KDUMP_* settings for /etc/sysconfig/kdump. SUSE only, see SUSE.

Default: {}

kdump_reboot_ok: If you run the role on a managed node that does not have memory reserved for crash kernel, i.e. the file /sys/kernel/kexec_crash_size contains 0, it might be required to reboot the managed node to configure kdump.

By default, the role does not reboot the managed node. If a managed node requires reboot, the role sets the kdump_reboot_required fact and fails, so that the user can reboot the managed node when needed. If you want the role to reboot the system if required, set this variable to true. You do not need to re-execute the role after boot.

Default: false

kdump_transactional_update_reboot_ok: This variable is used to handle reboots required by transactional updates. If a transactional update requires a reboot, the role will proceed with the reboot if kdump_transactional_update_reboot_ok is set to true. If set to false, the role will notify the user that a reboot is required, allowing for custom handling of the reboot requirement. If this variable is not set, the role will fail to ensure the reboot requirement is not overlooked. For non-transactional update systems, this variable is ignored.

Default: null

SUSE

Requires SLE 16 or Leap 16 or later. The role fails on older releases, whose kdumptool cannot reserve crash kernel memory.

Settings the role does not manage can be set with kdump_sysconfig, for example:

kdump_sysconfig:
  KDUMP_DUMPLEVEL: 31
  KDUMP_KEEP_OLD_DUMPS: 5

kdump_sysconfig may not set KDUMP_SAVEDIR, KDUMP_SSH_IDENTITY, KDUMP_HOST_KEY, KDUMP_CONTINUE_ON_ERROR or KDUMP_UPDATE_BOOTLOADER, which the role manages itself.

On SUSE:

  • When kdump_target is set, its type must be ssh or nfs. Without it, the dump is saved locally under kdump_path.
  • kdump_system_action: shell opens a debug shell when saving the dump fails; any other value continues and reboots.
  • kdump_core_collector, kdump_dracut_args and kdump_auto_reset_crashkernel have no effect.
  • On transactional update systems, the role cannot change the boot loader, so memory for the crash kernel must already be reserved, for example by transactional-update setup-kdump and a reboot. Otherwise the role fails. On these systems the role also sets KDUMP_UPDATE_BOOTLOADER="false", as setup-kdump does, and kdump_reboot_ok has no effect.

Ubuntu

To configure the default file-overwriting behavior, use for example:

kdump_kdump_tools:
  USE_KDUMP: 1
  KDUMP_KERNEL: /var/lib/kdump/vmlinuz
  KDUMP_INITRD: /var/lib/kdump/initrd.img
  KDUMP_COREDIR: "/var/crash"
  MAKEDUMP_ARGS: "-c -d 31"
  KDUMP_FAIL_CMD: "reboot -f"

Ansible Facts Returned by the Role

kdump_reboot_required: The role sets this fact if the managed node requires reboot to reserve memory for the crash kernel. Re-execute the role after boot to ensure that kdump is working.

rpm-ostree

See README-ostree.md

License

MIT

About

An ansible role which configures kdump

Resources

Contributing

Stars

19 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages