linux-system-roles.kdump
Ansible Role: Kernel Crash Dump
This is an Ansible role that sets up kdump.
Warning
This role will change the kdump settings on the managed host. Any previous settings will be removed, even if they are not mentioned in the role variables. It will at least change this configuration file:
/etc/kdump.conf
Requirements
Please see below.
Collection Requirements
This role only needs external collections for managing rpm-ostree
nodes. To install them, run this command if you need to manage rpm-ostree
nodes:
ansible-galaxy collection install -vv -r meta/collection-requirements.yml
Role Variables
kdump_target: Specifies where to save vmcore. If type
is raw
or a filesystem type, the location refers 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
, the location refers to a server, for example:
type: ssh
location: [email protected]
For nfs
, it will look like this:
type: nfs
location: nfs.example.com
Only the ssh
type is considered stable; the others are experimental.
kdump_path: The path to where vmcore will be written. If kdump_target
is set, the path is relative to that target. Otherwise, it must be an absolute path in the root filesystem.
kdump_core_collector: This command is used to copy the vmcore. If left empty, it will use makedumpfile
with options depending on the kdump_target.type
.
kdump_system_action: This specifies what to do if dumping the core file fails. Options are reboot
, halt
, poweroff
, or shell
.
kdump_auto_reset_crashkernel: This decides whether to reset the crashkernel to a new default value when kexec-tools
updates it, affecting existing kernels that use the old value.
kdump_dracut_args: Add extra dracut options when rebuilding the kdump initrd.
kdump_reboot_ok: If the managed node doesn't have memory reserved for the crash kernel (checked by /sys/kernel/kexec_crash_size
which shows 0
), a reboot may be necessary to set up kdump.
By default, the role does not reboot the node. If a reboot is needed, the role sets the kdump_reboot_required
fact and fails, allowing the user to reboot the node. To have the role reboot the system if needed, set this variable to true
. You won't need to run the role again after rebooting.
Default: false
Ansible Facts Returned by the Role
kdump_reboot_required: This fact is set if the managed node needs a reboot to finish the kdump setup. Run the role again after rebooting to make sure kdump is working.
rpm-ostree
Check README-ostree.md for more information.
License
MIT