Attempt to remove octavia tls proxy service only present

If the cli is podman we try to remove the octavia tls proxy systemd
service without checking it if exists, resulting in an error on
updates/upgrades. This patch makes those steps conditional on whether
the services exists.

Change-Id: I883e457ea60ebbf5290ab6afa9909386cc2f8f0c
Closes-Bug: #1886833
This commit is contained in:
Brent Eagles 2020-07-08 12:01:43 -02:30 committed by Carlos Goncalves
parent a6fd3bd273
commit bf279de03f
1 changed files with 21 additions and 15 deletions

View File

@ -409,21 +409,27 @@ outputs:
name: octavia_api_tls_proxy
state: absent
when: container_cli == 'docker'
- name: stop and disable octavia_api_tls_proxy container if podman
systemd:
name: tripleo_octavia_api_tls_proxy
state: stopped
enabled: no
when: container_cli == 'podman'
- name: clean up tripleo service file for octavia_api_tls_proxy
file:
state: absent
path: "/etc/systemd/system/tripleo_octavia_api_tls_proxy"
when: container_cli == 'podman'
- name: reload systemd
systemd:
daemon-reload: yes
when: container_cli == 'podman'
- name: "check if tripleo_octavia_api_tls_proxy service exists in systemd"
stat:
path: "/etc/systemd/system/tripleo_octavia_api_tls_proxy.service"
register: systemd_exists
- name: Remove tripleo_octavia_api_tls_proxy service
when:
- container_cli == 'podman'
- systemd_exists.stat.exists
block:
- name: stop and disable octavia_api_tls_proxy container
systemd:
name: tripleo_octavia_api_tls_proxy
state: stopped
enabled: no
- name: clean up tripleo service file for octavia_api_tls_proxy
file:
state: absent
path: "/etc/systemd/system/tripleo_octavia_api_tls_proxy.service"
- name: reload systemd
systemd:
daemon-reload: yes
upgrade_tasks:
- name: Set internal tls variable
set_fact: