From a13d516e1e9943c69721173380acc1c6d0e62693 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Thu, 2 May 2024 12:14:47 +0200 Subject: [PATCH] kolla: add play to fix long service restarts while using systemd (#404) Necessary when upgrading from OSISM 6 to OSISM 7. Closes osism/issues#973 Signed-off-by: Christian Berendt --- playbooks/kolla-fix-gh973.yml | 1 + playbooks/kolla/fix-gh973.yml | 40 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 120000 playbooks/kolla-fix-gh973.yml create mode 100644 playbooks/kolla/fix-gh973.yml diff --git a/playbooks/kolla-fix-gh973.yml b/playbooks/kolla-fix-gh973.yml new file mode 120000 index 0000000..6c4d001 --- /dev/null +++ b/playbooks/kolla-fix-gh973.yml @@ -0,0 +1 @@ +kolla/fix-gh973.yml \ No newline at end of file diff --git a/playbooks/kolla/fix-gh973.yml b/playbooks/kolla/fix-gh973.yml new file mode 100644 index 0000000..0ad192d --- /dev/null +++ b/playbooks/kolla/fix-gh973.yml @@ -0,0 +1,40 @@ +# https://github.com/osism/issues/issues/973 +# https://bugs.launchpad.net/kolla-ansible/+bug/2048130 +# https://review.opendev.org/c/openstack/kolla-ansible/+/904805 +--- +- name: Fix for osism/issues#973 + hosts: "{{ hosts_fix_973|default('common') }}" + + vars: + unit_files: + - kolla-cron-container.service + - kolla-designate_producer-container.service + - kolla-keystone_fernet-container.service + - kolla-letsencrypt_lego-container.service + - kolla-magnum_api-container.service + - kolla-mariadb_clustercheck-container.service + - kolla-neutron_l3_agent-container.service + - kolla-openvswitch_db-container.service + - kolla-openvswitch_vswitchd-container.service + - kolla-proxysql-container.service + + tasks: + - name: Check the unit files to be repaired + ansible.builtin.stat: + path: "/etc/systemd/system/{{ item }}" + loop: "{{ unit_files }}" + register: result + + - name: Repair unit file + become: true + ansible.builtin.lineinfile: + path: "/etc/systemd/system/{{ item.item }}" + insertafter: "^RestartSec=" + line: "SuccessExitStatus=143" + loop: "{{ result.results }}" + when: item["stat"].exists | bool + + - name: Reload systemd daemon + become: true + ansible.builtin.systemd: + daemon_reload: true