Skip to content

Commit

Permalink
In the fix-973 play fix all unit files (#407)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt authored May 2, 2024
1 parent e7e8744 commit b2300fb
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions playbooks/kolla/fix-gh973.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,25 @@
- 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 }}"
- name: Get all kolla unit files
ansible.builtin.find:
paths: /etc/systemd/system
recurse: no
patterns: "kolla-.*-container.service"
file_type: file
use_regex: yes
register: result

- name: Repair unit file
become: true
ansible.builtin.lineinfile:
path: "/etc/systemd/system/{{ item.item }}"
path: "{{ item.path }}"
insertafter: "^RestartSec="
line: "SuccessExitStatus=143"
loop: "{{ result.results }}"
when: item["stat"].exists | bool
loop: "{{ result.files }}"
loop_control:
label: "{{ item.path }}"
notify: Reload systemd daemon

handlers:
Expand Down

0 comments on commit b2300fb

Please sign in to comment.