disable neutron-l3-agent for odl-l3 87/18387/1
authorchenshuai <chenshuai@huawei.com>
Thu, 11 Aug 2016 06:37:39 +0000 (02:37 -0400)
committerchenshuai <chenshuai@huawei.com>
Thu, 11 Aug 2016 06:38:55 +0000 (02:38 -0400)
JIRA: COMPASS-471

Change-Id: I80d0ad6d95bb81d7a2592dd2c3a2051ac362494f
Signed-off-by: chenshuai <chenshuai@huawei.com>
deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml
deploy/adapters/ansible/roles/odl_cluster_neutron/tasks/main.yml

index 5c9b203..5109323 100755 (executable)
   service: name=keepalived state=stopped
   when: ansible_os_family == "Debian"
 
+################ l3 agent remove ###################
+- name: turn off neutron-l3-agent on control node
+  service: name=neutron-l3-agent state=stopped
+  when: odl_l3_agent == "Enable"
+
+- name: remove neutron-l3-agent daemon
+  shell: >
+    sed -i 'neutron-l3-agent/d' /opt/service ;
+    mv /etc/init.d/neutron-l3-agent /home/ ;
+    mv /etc/init/neutron-l3-agent.conf /home/ ;
+  when: odl_l3_agent == "Enable"
+####################################################
+
 - name: chown opendaylight directory and files
   shell: >
     chown -R odl:odl "{{ odl_home }}";
index 751a02d..3024dcf 100755 (executable)
@@ -11,7 +11,7 @@
 
 - name: restart neutron-l3-agent server
   service: name=neutron-l3-agent state=restarted
-  when: inventory_hostname in groups['odl']
+  when: inventory_hostname in groups['odl'] and odl_l3_agent == "Disable"
 
 - name: restart neutron-dhcp-agent server
   service: name=neutron-dhcp-agent state=restarted