Merge "tripleo-container-manage: add tripleo_container_manage_systemd_teardown" into stable/train

This commit is contained in:
Zuul 2020-02-07 21:25:04 +00:00 committed by Gerrit Code Review
commit 372594aa0b
2 changed files with 40 additions and 40 deletions

View File

@ -27,3 +27,4 @@ tripleo_container_manage_debug: false
tripleo_container_manage_healthcheck_disabled: false tripleo_container_manage_healthcheck_disabled: false
tripleo_container_manage_log_path: '/var/log/containers/stdouts' tripleo_container_manage_log_path: '/var/log/containers/stdouts'
tripleo_container_manage_systemd_order: false tripleo_container_manage_systemd_order: false
tripleo_container_manage_systemd_teardown: true

View File

@ -18,58 +18,57 @@
# It'll try to remove the healthcheck, service and then container without # It'll try to remove the healthcheck, service and then container without
# much validation in case things failed in the middle. # much validation in case things failed in the middle.
- name: "Remove systemd healthcheck for {{ item }}" - name: "Disable systemd resources for {{ item }}"
when: tripleo_container_manage_systemd_teardown
block: block:
- name: "Stop and disable systemd timer for {{ item }}" - name: "Remove systemd healthcheck for {{ item }}"
block:
- name: "Stop and disable systemd timer for {{ item }}"
systemd:
state: stopped
name: "tripleo_{{ item }}_healthcheck.timer"
enabled: false
ignore_errors: true
- name: "Delete systemd timer file for {{ item }}"
file:
path: "/etc/systemd/system/tripleo_{{ item }}_healthcheck.timer"
state: absent
register: systemd_timer_deleted
- name: "Stop and disable systemd healthcheck for {{ item }}"
systemd:
state: stopped
name: "tripleo_{{ item }}_healthcheck.service"
enabled: false
ignore_errors: true
- name: "Delete systemd healthcheck file for {{ item }}"
file:
path: "/etc/systemd/system/tripleo_{{ item }}_healthcheck.service"
state: absent
register: systemd_healthcheck_deleted
- name: Force systemd to reread configs
systemd:
daemon_reload: true
when: systemd_timer_deleted.changed or systemd_healthcheck_deleted.changed
- name: "Stop and disable systemd service for {{ item }}"
systemd: systemd:
state: stopped state: stopped
name: "tripleo_{{ item }}_healthcheck.timer" name: "tripleo_{{ item }}.service"
enabled: false enabled: false
ignore_errors: true ignore_errors: true
- name: "Delete systemd timer file for {{ item }}" - name: "Delete systemd unit file for {{ item }}"
file: file:
path: "/etc/systemd/system/tripleo_{{ item }}_healthcheck.timer" path: "/etc/systemd/system/tripleo_{{ item }}.service"
state: absent state: absent
register: systemd_timer_deleted register: systemd_file_deleted
- name: "Stop and disable systemd healthcheck for {{ item }}" - name: "Remove trailing .requires for {{ item }}"
systemd:
state: stopped
name: "tripleo_{{ item }}_healthcheck.service"
enabled: false
ignore_errors: true
- name: "Delete systemd healthcheck file for {{ item }}"
file: file:
path: "/etc/systemd/system/tripleo_{{ item }}_healthcheck.service" path: "/etc/systemd/system/tripleo_{{ item }}.requires"
state: absent state: absent
register: systemd_healthcheck_deleted register: systemd_requires_deleted
- name: Force systemd to reread configs - name: Force systemd to reread configs
systemd: systemd:
daemon_reload: true daemon_reload: true
when: systemd_timer_deleted.changed or systemd_healthcheck_deleted.changed when: systemd_file_deleted.changed or systemd_requires_deleted.changed
- name: "Stop and disable systemd service for {{ item }}"
systemd:
state: stopped
name: "tripleo_{{ item }}.service"
enabled: false
ignore_errors: true
- name: "Delete systemd unit file for {{ item }}"
file:
path: "/etc/systemd/system/tripleo_{{ item }}.service"
state: absent
register: systemd_file_deleted
- name: "Remove trailing .requires for {{ item }}"
file:
path: "/etc/systemd/system/tripleo_{{ item }}.requires"
state: absent
register: systemd_requires_deleted
- name: Force systemd to reread configs
systemd:
daemon_reload: true
when: systemd_file_deleted.changed or systemd_requires_deleted.changed
- name: "Remove container {{ item }}" - name: "Remove container {{ item }}"
podman_container: podman_container: