An Ansible to install and configure kdump on a host.
Kdump and kexec are tools often used to debug and analyze errors and crashes.
This role ensure, that kexec and kdump are properly installed and configured.
Used Modules:
Install from Ansible Galaxy
ansible-galaxy install while_true_do.sys_kdump
Install from Github
git clone https://github.com/while-true-do/ansible-role-sys_kdump.git while_true_do.sys_kdump
---
# defaults file for while_true_do.sys_kdump
## Package Management
wtd_sys_kdump_package:
- kexec-tools
# State can be present|latest|absent
wtd_sys_kdump_package_state: "present"
## Service Management
wtd_sys_kdump_service: "kdump"
# State can be started|stopped
wtd_sys_kdump_service_state: "started"
wtd_sys_kdump_service_enabled: true
## Configuration Management
# Variables for /etc/kdump.conf
# Please read templates/kdump.conf.j2
wtd_sys_kdump_conf:
# Define the method to dump the vmcore
# (raw|nfs|ssh|<fs type>|path)
method: "path"
# address or path for method
target: "/var/crash"
# ssh key, in case you want to use method: ssh^
# sshkey: "/root/.ssh/kdump_id_rsa"
# parameters for collector
# collector: "makedumpfile -F -l --message-level 1 -d 31"
collector: "makedumpfile -l --message-level 1 -d 31"
# binary|script to run after vmcore dump
# post: "/var/crash/scripts/kdump-post.sh"
# binary|script to run before vmcore dump
# pre: "/var/crash/scripts/kdump-pre.sh"
# binary|script to be included in the kdump initrd
# extra_bins: "/usr/bin/lftp"
# extra kernel modules included in kdump initrd
# extra_modules: "gfs2"
# action to perform, in case kdump fails
# (reboot|halt|poweroff|shell)
default: "reboot"
# specify, if initrd must be rebuild
# (0|1)
# force_rebuild: "1"
# specify, if initrd must never be rebuild
# (0|1)
# force_no_rebuild: "1"
# force unresettable blockdevice as target
# (0|1)
# override_resettable: "1"
# extra dracut options to be inclued in initrd
# dracut_args: '--omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3"'
# arguments for fence_kdump_send
# fence_kdump_args: "-p 7410 -f auto -c 0 -i 10"
# list all cluster nodes, except localhost
# fence_kdump_nodes: "node1 node2"
## Host Management
wtd_sys_kdump_reboot_enabled: false
wtd_sys_kdump_reboot_msg: "System is going down to apply kdump configuration."
wtd_sys_kdump_reboot_timeout: "3600"
Running Ansible Roles can be done in a playbook.
---
- hosts: all
roles:
- role: while_true_do.sys_kdump
Use an nfs address as target.
- hosts: all
roles:
- role: while_true_do.sys_kdump
wtd_sys_kdump_conf:
method: "nfs"
target: "192.168.10.1:/path/to/dir"
collector: "makedumpfile -l --message-level 1 -d 31"
default: "reboot"
- RedHat Testing is currently not possible in public, due to limitations in subscriptions.
- Some services and features cannot be tested properly, due to limitations in docker.
- Grub is not configured by this role.
Most of the "generic" tests are located in the Test Library.
Ansible specific testing is done with Molecule.
Infrastructure testing is done with testinfra.
Automated testing is done with Travis CI.
Thank you so much for considering to contribute. We are very happy, when somebody is joining the hard work. Please fell free to open Bugs, Feature Requests or Pull Requests after reading the Contribution Guideline.
See who has contributed already in the kudos.txt.
This work is licensed under a BSD-3-Clause License.
- Site https://while-true-do.io
- Twitter https://twitter.com/wtd_news
- Code https://github.com/while-true-do
- Mail hello@while-true-do.io
- IRC freenode, #while-true-do
- Telegram https://t.me/while_true_do