5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 - name: Create coredump directory to log volume
18 file: path=/var/log/coredump state=directory
20 - name: Remote old coredump directory
21 file: path=/var/lib/systemd/coredump state=absent
23 - name: Create link so that coredumps go to log volume
25 src: '/var/log/coredump'
26 dest: '/var/lib/systemd/coredump'
29 - name: Create coredump configuration directory
30 file: path=/etc/systemd/coredump.conf.d state=directory
32 - name: Enable core files
34 src: "01-enable-cores.conf"
35 dest: "/etc/systemd/coredump.conf.d/01-enable-cores.conf"
39 - core-handling-config
41 - name: Enable only backtraces
43 src: "02-only-backtrace.conf"
44 dest: "/etc/systemd/coredump.conf.d/02-only-backtrace.conf"
48 - core-handling-config
50 - name: Enable core dumping
52 name: kernel.core_pattern
53 value: '|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %e'
54 sysctl_file: /etc/sysctl.d/50-coredump.conf