Skip to content

Commit 46c7b73

Browse files
fabienarchambaultrichm
authored andcommitted
Update main.yml with __kdump_conf_file
1 parent c91b3f9 commit 46c7b73

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

tasks/main.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,18 @@
1919
when:
2020
- kdump_target.type | d(none) == 'ssh'
2121

22-
- name: Get mode of /etc/kdump.conf if it exists
22+
- name: Get mode of kdump configuration file if it exists
2323
stat:
24-
path: /etc/kdump.conf
24+
path: "{{ __kdump_conf_file }}"
2525
register: __kdump_conf
2626

27-
- name: Generate /etc/kdump.conf
27+
- name: Generate kdump configuration file
2828
template:
29-
src: kdump.conf.j2
30-
dest: /etc/kdump.conf
29+
src: "{{ __kdump_conf_file.split('/')[-1] }}.j2"
30+
dest: "{{ __kdump_conf_file }}"
3131
backup: true
3232
mode: "{{ __kdump_conf.stat.mode | d('0644') }}"
3333
notify: Restart kdump
34-
when: ansible_facts['os_family'] == 'RedHat'
35-
36-
- name: Generate /etc/default/kdump-tools
37-
template:
38-
src: kdump-tools.j2
39-
dest: /etc/default/kdump-tools
40-
backup: true
41-
mode: "{{ __kdump_conf.stat.mode | d('0644') }}"
42-
notify: Restart kdump
43-
when: ansible_facts['distribution'] in ['Ubuntu']
4434

4535
- name: Find out reserved memory for the crash kernel
4636
slurp:

vars/Ubuntu.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ __kdump_packages:
66
- linux-crashdump
77
- openssh-client
88

9+
__kdump_conf_file: /etc/default/kdump-tools
910
__kdump_service: kdump-tools

vars/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ __kdump_is_rh_distro_fedora: "{{ ansible_distribution in __kdump_rh_distros_fedo
4545
# END - DO NOT EDIT THIS BLOCK - rh distros variables
4646

4747
__kdump_service: kdump
48+
49+
__kdump_conf_file: /etc/kdump.conf

0 commit comments

Comments
 (0)