From 72ee1ff418a992fb93f934c7de99f9bee570afc5 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Tue, 8 Feb 2022 09:44:02 +0100 Subject: [PATCH] Only remove old services after they are stopped Otherwise Ansible won't be able to stop them. Change-Id: I990f5659ce501fa8ed95c2b18723189fe10f05d3 --- .../roles/bifrost-ironic-install/tasks/bootstrap.yml | 8 -------- playbooks/roles/bifrost-ironic-install/tasks/start.yml | 8 ++++++++ releasenotes/notes/service-upgrade-54fda4d86e9d7575.yaml | 7 +++++++ 3 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 releasenotes/notes/service-upgrade-54fda4d86e9d7575.yaml diff --git a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml index bfe7fa9fa..2cc6a667b 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml @@ -264,14 +264,6 @@ service_name: 'ironic' config_file: '/etc/ironic/ironic.conf' -- name: "Remove old ironic services" - file: - path: "{{ init_dest_dir }}{{ item }}.service" - state: absent - loop: - - ironic-api - - ironic-conductor - - name: "Create and populate /tftpboot" import_tasks: create_tftpboot.yml diff --git a/playbooks/roles/bifrost-ironic-install/tasks/start.yml b/playbooks/roles/bifrost-ironic-install/tasks/start.yml index da388d054..33919921f 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/start.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/start.yml @@ -40,6 +40,14 @@ - ironic-api - ironic-conductor +- name: "Remove old ironic services" + file: + path: "{{ init_dest_dir }}{{ item }}.service" + state: absent + loop: + - ironic-api + - ironic-conductor + - name: "Start ironic" service: name: ironic diff --git a/releasenotes/notes/service-upgrade-54fda4d86e9d7575.yaml b/releasenotes/notes/service-upgrade-54fda4d86e9d7575.yaml new file mode 100644 index 000000000..329e0a6dd --- /dev/null +++ b/releasenotes/notes/service-upgrade-54fda4d86e9d7575.yaml @@ -0,0 +1,7 @@ +--- +issues: + - | + A bug in the upgrade logic could leave the old ``ironic-api`` and + ``ironic-conductor`` services running. It has been fixed, but if you + have already upgraded to an affected version, you need to stop the + services manually using ``systemctl``.