-
Notifications
You must be signed in to change notification settings - Fork 2
/
kdump.sls
55 lines (48 loc) · 1.47 KB
/
kdump.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
kdump:
pkg.installed:
- refresh: False
- retry: # some packages can change rapidly in our repos needing a retry as zypper does not do that
attempts: 5
python3-augeas:
pkg.installed:
# python3 is now a capability provided by a minor version package
- resolve_capabilities: True
- refresh: False
- retry:
attempts: 5
/etc/default/grub:
file.append:
- text:
{%- for config_line in ['GRUB_CMDLINE_LINUX_DEFAULT', 'GRUB_CMDLINE_XEN_DEFAULT'] %}
- '{{ config_line }}+=" crashkernel=307M"'
{%- endfor %}
update grub config with crashkernel setting:
cmd.run:
- name: 'grub2-mkconfig -o /boot/grub2/grub.cfg'
- onchanges:
- file: /etc/default/grub
- onlyif: grub2-probe /boot
/etc/systemd/system/check-for-kernel-crash.service:
file.managed:
- mode: "0644"
- source: salt://openqa/check-for-kernel-crash.service
kdump-conf:
augeas.change:
- require:
- pkg: python3-augeas
- lens: Shellvars.lns
- context: /files/etc/sysconfig/kdump
- changes:
- set KDUMP_SMTP_SERVER '"relay.suse.de"'
- set KDUMP_NOTIFICATION_TO '"[email protected]"'
{%- if not grains.get('noservices', False) %}
# as kdump needs reserved memory which is only made effective by a reboot we
# must not start the service but only enable it to be started on bootup
kdump-service:
service.enabled:
- name: kdump.service
- watch:
- augeas: kdump-conf
check-for-kernel-crash:
service.enabled
{%- endif %}