From c464e3b64bd0f9e93a4540eb8fe4b90d73b7a862 Mon Sep 17 00:00:00 2001 From: Flavio Ramalho Date: Wed, 9 Mar 2016 15:32:12 -0300 Subject: [PATCH] Check for a different version of LBaaS agent before stop This patch fixes the task which tries to stop neutron-lbaas-agent. When the neutron-lbaas-agent is not installed the task fails. Added tasks to check if there is a different version of the neutron LBaaS agent service configured before tring to stop it. Change-Id: I0ae17303903f8eb7909638f6217fe94a9fd9bb6b Closes-Bug: #1555256 --- tasks/neutron_lbaas.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tasks/neutron_lbaas.yml b/tasks/neutron_lbaas.yml index 13e3e735..79f809b5 100644 --- a/tasks/neutron_lbaas.yml +++ b/tasks/neutron_lbaas.yml @@ -20,16 +20,30 @@ # # These tasks will ensure that the correct agent is the only one running. +- name: Check if LBaaS agent v1 upstart script exists when v2 is in neutron_plugins_base + stat: path=/etc/init/neutron-lbaas-agent.conf + register: neutron_lbaas_upstart + when: neutron_lbaasv2 | bool + +- name: Check if LBaaS agent v2 upstart script exists when v1 is in neutron_plugins_base + stat: path=/etc/init/neutron-lbaasv2-agent.conf + register: neutron_lbaasv2_upstart + when: neutron_lbaas | bool + - name: Ensure LBaaS v1 agent is stopped when v2 is in neutron_plugins_base service: name: neutron-lbaas-agent enabled: no state: stopped - when: neutron_lbaasv2 | bool + when: + - neutron_lbaasv2 | bool + - neutron_lbaas_upstart.stat.exists - name: Ensure LBaaS v2 agent is stopped when v1 is in neutron_plugins_base service: name: neutron-lbaasv2-agent enabled: no state: stopped - when: neutron_lbaas | bool + when: + - neutron_lbaas | bool + - neutron_lbaasv2_upstart.stat.exists