add feature to disable coredump to limit task (#511)

Signed-off-by: Ludwig Bayerlein <bayerlein@bayerlein-networks.com>

Co-authored-by: Ludwig Bayerlein <bayerlein@bayerlein-networks.com>
This commit is contained in:
lbayerlein 2021-12-08 14:25:49 +01:00 committed by GitHub
parent db78f612f5
commit bb8e3e375e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 0 deletions

View file

@ -34,3 +34,38 @@
path: /etc/security/limits.d/10.hardcore.conf
state: absent
when: os_security_kernel_enable_core_dump | bool
- block:
- name: create coredump.conf.d-directory if it does not exist
file:
path: '/etc/systemd/coredump.conf.d'
owner: root
group: root
mode: 0755
state: directory
- name: create custom.conf for disabling coredumps
template:
src: 'etc/systemd/coredump.conf.d/coredumps.conf.j2'
dest: '/etc/systemd/coredump.conf.d/custom.conf'
owner: root
group: root
mode: 0644
- name: Reload daemon
systemd:
daemon_reload: yes
when: not os_security_kernel_enable_core_dump | bool
- block:
- name: Remove coredump.conf.d directory with files
file:
path: /etc/systemd/coredump.conf.d
state: absent
- name: Reload daemon
systemd:
daemon_reload: yes
when: os_security_kernel_enable_core_dump | bool

View file

@ -0,0 +1,2 @@
[Coredump]
Storage=none