diff --git a/playbooks/postdeploy.yml b/playbooks/postdeploy.yml index 90539e4..1664131 100644 --- a/playbooks/postdeploy.yml +++ b/playbooks/postdeploy.yml @@ -5,3 +5,9 @@ include_role: name: patch_keystone tasks_from: patch_trusted_dashboard.yml + +- hosts: overcloud + tasks: + - name: disable log_martians + include_role: + name: disable_log_martians diff --git a/playbooks/roles/disable_log_martians/tasks/main.yml b/playbooks/roles/disable_log_martians/tasks/main.yml new file mode 100644 index 0000000..85214f6 --- /dev/null +++ b/playbooks/roles/disable_log_martians/tasks/main.yml @@ -0,0 +1,30 @@ +--- +- name: remove any log_martians setting from 99-sysctl.conf + lineinfile: + path: /etc/sysctl.d/99-sysctl.conf + regexp: log_martians + state: absent + +- name: get a list of sysctl settings + shell: >- + sysctl -a 2> /dev/null | grep log_martians + changed_when: false + register: sysctl + +- name: remove existing config file + file: + path: "{{ log_martians_sysctl_file }}" + state: absent + when: refresh_sysctl_file|default(false)|bool + +- name: disable log_martians + sysctl: + name: "{{ item.split()|first }}" + value: "0" + sysctl_file: "{{ log_martians_sysctl_file }}" + sysctl_set: true + when: >- + 'vxlan' not in item + and 'tbr' not in item + and 'tap' not in item + loop: "{{ sysctl.stdout_lines }}"