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