From 2869d008e2e417e43f3fbf942225a9edc5868e37 Mon Sep 17 00:00:00 2001 From: Arnau Verdaguer Date: Tue, 26 Apr 2022 16:08:56 +0200 Subject: [PATCH] [OVN][Migration] More robust checks on stop-agents On OSP17 there are some ml2 ovs services that are not present on some computes eventhought is defined on the ansible service facts. This patch will ensure that only those services that are actually running will be stopped. Change-Id: I94f0832d09d263837262ada109a567e864915a1a --- .../playbooks/roles/stop-agents/tasks/cleanup.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/ovn_migration/tripleo_environment/playbooks/roles/stop-agents/tasks/cleanup.yml b/tools/ovn_migration/tripleo_environment/playbooks/roles/stop-agents/tasks/cleanup.yml index e74aa9e629c..49c2bcbf085 100644 --- a/tools/ovn_migration/tripleo_environment/playbooks/roles/stop-agents/tasks/cleanup.yml +++ b/tools/ovn_migration/tripleo_environment/playbooks/roles/stop-agents/tasks/cleanup.yml @@ -5,11 +5,15 @@ state: stopped enabled: no become: yes + when: + - ansible_facts.services[item] is defined + - ansible_facts.services[item]["state"] == "running" loop: - "{{ service.healthcheck_timer_file }}" - "{{ service.healthcheck_service_file }}" - "{{ service.service_file }}" +# If file is already deleted this won't fail - name: delete ml2 ovs systemd service files file: path: "{{ systemd_service_file_dir }}/{{ item }}"