summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/odl_cluster/tasks
diff options
context:
space:
mode:
authorchenshuai@huawei.com <chenshuai@huawei.com>2015-12-15 23:09:47 +0800
committershuai chen <chenshuai@huawei.com>2015-12-25 00:52:29 +0000
commit21e1b393c0fc7f52c831882b53454877f6942495 (patch)
tree397c47f7e22450542522aeb5cdc5b9eabced273f /deploy/adapters/ansible/roles/odl_cluster/tasks
parent01338238984e899dc7274e03618c9e9998c63d96 (diff)
bugfix: remove service check temporily during install odl
JIRA: COMPASS-203 Change-Id: I4cb9109c687a869ac8bef94b472ec3fbc0b74df5 Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/odl_cluster/tasks')
-rwxr-xr-xdeploy/adapters/ansible/roles/odl_cluster/tasks/main.yml8
-rwxr-xr-xdeploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml32
-rwxr-xr-xdeploy/adapters/ansible/roles/odl_cluster/tasks/openvswitch.yml65
3 files changed, 80 insertions, 25 deletions
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml
index 2254f11f..738da5b2 100755
--- a/deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml
@@ -12,9 +12,9 @@
- meta: flush_handlers
- name: check out new flow table if enable
- shell: ovs-ofctl --protocol=OpenFlow13 dump-flows br-prv | grep CONTROLLER; while [ $? -ne 0 ]; do sleep 10; ovs-ofctl --protocol=OpenFlow13 dump-flows br-prv | grep CONTROLLER; done
+ shell: ovs-ofctl --protocol=OpenFlow13 dump-flows br-int | grep CONTROLLER; while [ $? -ne 0 ]; do sleep 10; ovs-ofctl --protocol=OpenFlow13 dump-flows br-int | grep CONTROLLER; done
when: groups['odl']|length !=0
-- name: remove controller from br-prv
- shell: ovs-vsctl del-controller br-prv;
- when: groups['odl']|length !=0
+#- name: remove controller from br-prv
+# shell: ovs-vsctl del-controller br-prv;
+# when: groups['odl']|length !=0
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml
index 0c13ff21..2cd4e23a 100755
--- a/deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml
@@ -66,15 +66,15 @@
dest: "{{ service_file.dst }}"
mode: 0644
-#- name: create karaf config
-# template:
-# src: org.apache.karaf.features.cfg
-# dest: "{{ odl_home }}/etc/org.apache.karaf.features.cfg"
-# owner: odl
-# group: odl
-# mode: 0775
-# notify:
-# - restart odl service
+- name: create karaf config
+ template:
+ src: org.apache.karaf.features.cfg
+ dest: "{{ odl_home }}/etc/org.apache.karaf.features.cfg"
+ owner: odl
+ group: odl
+ mode: 0775
+ notify:
+ - restart odl service
- name: create tomcat config
template:
@@ -83,6 +83,12 @@
notify:
- restart odl service
+
+- name: install odl pip packages
+ pip: name={{ item }} state=present
+ with_items: odl_pip_packages
+
+
#- name: restart odl service
# service: name=opendaylight state=started pattern="opendaylight"
@@ -153,6 +159,9 @@
##########################################################################################################
################################ OpenDayLight connect with OpenStack ################################
##########################################################################################################
+- name: Turn off neutron-server Daemon on control node
+ shell: sed -i '/neutron-plugin-openvswitch-agent/d' /opt/service ;
+
- name: Turn off neutron-server on control node
service: name=neutron-server state=stopped
@@ -193,3 +202,8 @@
- name: Restart neutron-server
service: name=neutron-server state=started
+
+- name: Add service daemon
+ shell: >
+ echo opendaylight >> /opt/service ;
+ echo neutron-server >> /opt/service ;
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/openvswitch.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/openvswitch.yml
index 3bef2af3..6f063c76 100755
--- a/deploy/adapters/ansible/roles/odl_cluster/tasks/openvswitch.yml
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/openvswitch.yml
@@ -12,31 +12,72 @@
- name: Adjust Service Daemon
shell: >
sed -i '/neutron-plugin-openvswitch-agent/d' /opt/service ;
- echo opendaylight >> /opt/service ;
- name: shut down and disable Neutron's openvswitch agent services
service: name=neutron-plugin-openvswitch-agent state=stopped
-- name: Stop the Open vSwitch service and clear existing OVSDB
- shell: >
- ovs-ofctl del-flows br-int ;
- ovs-vsctl del-br br-tun ;
- ovs-vsctl del-manager ;
+#- name: Stop the Open vSwitch service and clear existing OVSDB
+# shell: >
+# ovs-ofctl del-flows br-int ;
+# ovs-vsctl del-br br-tun ;
+# ovs-vsctl del-port br-int patch-tun;
+# ovs-vsctl del-manager ;
+
+#- name: Restart OpenVSwitch
+# shell: service openvswitch-switch restart;
#- name: remove Neutron's openvswitch agent services
# shell: >
# update-rc.d neutron-plugin-openvswitch-agent remove
-#- name: Stop the Open vSwitch service and clear existing OVSDB
-# shell: >
-# service openvswitch-switch stop ;
-# rm -rf /var/log/openvswitch/* ;
-# rm -rf /etc/openvswitch/conf.db ;
-# service openvswitch-switch start ;
+- name: Check External network
+ shell: ovs-vsctl list-br | grep br-prv
+ register: extbr
+
+- name: Stop the Open vSwitch service and clear existing OVSDB
+ shell: >
+ service openvswitch-switch stop ;
+ rm -rf /var/log/openvswitch/* ;
+ rm -rf /etc/openvswitch/conf.db ;
+ service openvswitch-switch start ;
- name: Set OpenDaylight as the manager
command: su -s /bin/sh -c "ovs-vsctl set-manager tcp:{{ internal_vip.ip }}:6640;"
+##################################################################
+################ Recover External network #######################
+##################################################################
+- name: add ovs bridge
+ openvswitch_bridge: bridge={{ item["name"] }} state=present
+ with_items: "{{ network_cfg['provider_net_mappings'] }}"
+ when: item["type"] == "ovs" and extbr.rc == 0
+
+- name: add ovs uplink
+ openvswitch_port: bridge={{ item["name"] }} port={{ item["interface"] }} state=present
+ with_items: "{{ network_cfg['provider_net_mappings'] }}"
+ when: item["type"] == "ovs" and extbr.rc == 0
+
+- name: copy recovery script
+ copy: src={{ item }} dest=/opt/setup_networks
+ with_items:
+ - recover_network.py
+ when: extbr.rc == 0
+
+- name: Recover external script
+ shell: python /opt/setup_networks/recover_network.py
+ when: extbr.rc == 0
+
+- name: start and disable Neutron's agent services
+ shell: service keepalived restart
+ when: inventory_hostname in groups['odl'] and extbr.rc == 0
+
+##################################################################
+##################################################################
+##################################################################
+
+
+
+
#- name: start and disable Neutron's agent services
# service: name=neutron-plugin-openvswitch-agent state=started