X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=roles%2Fcore-handling-config%2Ftasks%2Fmain.yml;fp=roles%2Fcore-handling-config%2Ftasks%2Fmain.yml;h=3a38a3b71746aed9934142452ef47fe6380e6e8c;hb=74a49ba6ef2ea715fa492db0bcd85c30398688e8;hp=0000000000000000000000000000000000000000;hpb=a936af362724cca0c5dc2c424902d398f9833410;p=ta%2Finfra-ansible.git diff --git a/roles/core-handling-config/tasks/main.yml b/roles/core-handling-config/tasks/main.yml new file mode 100644 index 0000000..3a38a3b --- /dev/null +++ b/roles/core-handling-config/tasks/main.yml @@ -0,0 +1,55 @@ +--- + +# Copyright 2019 Nokia + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- name: Create coredump directory to log volume + file: path=/var/log/coredump state=directory + +- name: Remote old coredump directory + file: path=/var/lib/systemd/coredump state=absent + +- name: Create link so that coredumps go to log volume + file: + src: '/var/log/coredump' + dest: '/var/lib/systemd/coredump' + state: link + +- name: Create coredump configuration directory + file: path=/etc/systemd/coredump.conf.d state=directory + +- name: Enable core files + copy: + src: "01-enable-cores.conf" + dest: "/etc/systemd/coredump.conf.d/01-enable-cores.conf" + owner: "root" + group: "root" + tags: + - core-handling-config + +- name: Enable only backtraces + copy: + src: "02-only-backtrace.conf" + dest: "/etc/systemd/coredump.conf.d/02-only-backtrace.conf" + owner: "root" + group: "root" + tags: + - core-handling-config + +- name: Enable core dumping + sysctl: + name: kernel.core_pattern + value: '|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %e' + sysctl_file: /etc/sysctl.d/50-coredump.conf +