Merge "Fix how tripleo_multipathd updates multipath.conf" into stable/wallaby

This commit is contained in:
Zuul 2022-02-18 01:08:22 +00:00 committed by Gerrit Code Review
commit a2d0dc8c70
2 changed files with 22 additions and 11 deletions

View File

@ -39,15 +39,8 @@
register: multipath_conf_containers
changed_when: false
# Services that use os-brick (e.g. cinder-volume, nova-compute) only access
# /etc/multipath.conf sporadically, so it's sufficient to refresh the
# container's copy of the file. The services do not need to be restarted.
- name: Refresh their /etc/multipath.conf
command: "{{ tripleo_container_cli }} cp /etc/multipath.conf {{ item }}:/etc/"
- name: Restart containers in order to refresh their /etc/multipath.conf
include_tasks: restart.yml
loop: "{{ multipath_conf_containers.stdout_lines | default([]) }}"
# The multipathd service does need to be restarted.
- name: Restart multipathd
command: "{{ tripleo_container_cli }} restart multipathd"
when:
- "'multipathd' in multipath_conf_containers.stdout | default('')"
loop_control:
loop_var: multipath_container

View File

@ -0,0 +1,18 @@
# Most containers are managed by systemd, but some are managed by pacemaker.
- name: "Check if the {{ multipath_container }} container is managed by systemd"
systemd:
name: "tripleo_{{ multipath_container }}"
enabled: yes
failed_when: false
changed_when: false
register: systemd_service
- name: "Restart {{ multipath_container }} using systemd"
systemd:
name: "tripleo_{{ multipath_container }}"
state: restarted
when: "'status' in systemd_service"
- name: "Restart {{ multipath_container }} using {{ tripleo_container_cli }}"
command: "{{ tripleo_container_cli }} restart {{ multipath_container }}"
when: "'status' not in systemd_service"