From 2ee69f20b5124924a7b20f4ca420d4f869596023 Mon Sep 17 00:00:00 2001 From: Brent Eagles Date: Wed, 8 Jul 2020 12:01:43 -0230 Subject: [PATCH] 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 (cherry picked from commit bf279de03f326fa53b31a08e733e15053a896492) (cherry picked from commit 2971c4fbb96d7c5e8d2bcfe568773929a222366e) --- .../octavia/octavia-api-container-puppet.yaml | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/deployment/octavia/octavia-api-container-puppet.yaml b/deployment/octavia/octavia-api-container-puppet.yaml index 7ba4c3cb73..54eda53f23 100644 --- a/deployment/octavia/octavia-api-container-puppet.yaml +++ b/deployment/octavia/octavia-api-container-puppet.yaml @@ -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: