diff options
author | chenshuai@huawei.com <chenshuai@huawei.com> | 2016-10-31 06:08:09 -0400 |
---|---|---|
committer | chenshuai@huawei.com <chenshuai@huawei.com> | 2016-10-31 22:40:50 -0400 |
commit | d12db678f51a6e9227a30e92cbb909909a8eda1d (patch) | |
tree | 9bfd6be9951ef9f39f5ee07edfed0a85f0006f2d /deploy/adapters/ansible/openstack_mitaka_xenial/roles | |
parent | 59b0e20b6c1f7f80ce7dcacfa8fb5e1687eefeea (diff) |
code refactoring: opendaylight for removing repeatedly files
JIRA: COMPASS-500
Change-Id: Ic3378804550f529e2ca438f2a3f84f3ffc09ef8f
Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/openstack_mitaka_xenial/roles')
14 files changed, 0 insertions, 318 deletions
diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/00_odl_common.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/00_odl_common.yml deleted file mode 100755 index 1545314d..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/00_odl_common.yml +++ /dev/null @@ -1,13 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: install controller packages - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" - with_items: common_packages | union(common_packages_noarch) diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_01_create_odl_user_and_group.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_01_create_odl_user_and_group.yml deleted file mode 100644 index cd6e9751..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_01_create_odl_user_and_group.yml +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: create odl group - group: name=odl system=yes state=present - -- name: create odl user - user: - name: odl - group: odl - home: "{{ odl_home }}" - createhome: "yes" - system: "yes" - shell: "/bin/false" diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_02_unarchive_odl_and_jdk.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_02_unarchive_odl_and_jdk.yml deleted file mode 100644 index ff82eba1..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_02_unarchive_odl_and_jdk.yml +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: unarchive onos driver package - command: su -s /bin/sh -c "tar xvf /opt/install_jdk8.tar -C /opt/" - -- name: install install_jdk8 package - command: su -s /bin/sh -c "/opt/install_jdk8/install_jdk8.sh" - -- name: extract odl package - command: su -s /bin/sh -c "tar xzf /opt/{{ odl_pkg_name }} -C {{ odl_home }} --strip-components 1 --no-overwrite-dir -k --skip-old-files" odl diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_05_clean_up_karaf_data.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_05_clean_up_karaf_data.yml deleted file mode 100644 index 5e34a428..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_05_clean_up_karaf_data.yml +++ /dev/null @@ -1,14 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: remove karaf data directory - shell: rm -rf {{ odl_home }}/data/*; - - diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_07_start_check_odl.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_07_start_check_odl.yml deleted file mode 100644 index 5fa4b921..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_07_start_check_odl.yml +++ /dev/null @@ -1,30 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: chown opendaylight directory and files - shell: > - chown -R odl:odl "{{ odl_home }}"; - chown odl:odl "{{ service_file.dst }}"; - -- name: start opendaylight - service: name=opendaylight state=started - when: ansible_os_family == "Debian" - -- name: set opendaylight autostart - shell: chkconfig opendaylight on - when: ansible_os_family == "RedHat" - -- name: start opendaylight - shell: service opendaylight start - when: ansible_os_family == "RedHat" - -- name: check if opendaylight running - shell: netstat -lpen --tcp | grep java | grep 6653; while [ $? -ne 0 ]; do sleep 10; netstat -lpen --tcp | grep java | grep 6653; done - diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_08_configure_neutron.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_08_configure_neutron.yml deleted file mode 100644 index 3d01a3a8..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/01_08_configure_neutron.yml +++ /dev/null @@ -1,35 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: configure l2 configuration - shell: crudini --set /etc/neutron/l3_agent.ini DEFAULT external_network_bridge br-prv; - when: odl_l3_agent == "Disable" - -- name: configure l3 configuration - shell: crudini --set /etc/neutron/l3_agent.ini DEFAULT external_network_bridge br-ex; - when: odl_l3_agent == "Enable" - -- name: configure odl l3 driver - shell: crudini --set /etc/neutron/neutron.conf DEFAULT service_plugins networking_odl.l3.l3_odl.OpenDaylightL3RouterPlugin; - when: odl_l3_agent == "Enable" - -- name: configure metadata for l3 configuration - shell: crudini --set /etc/neutron/dhcp_agent.ini DEFAULT enable_isolated_metadata True; - when: odl_l3_agent == "Enable" - -- name: drop and recreate neutron database - shell: mysql -e "drop database if exists neutron;"; - mysql -e "create database neutron character set utf8;"; - mysql -e "grant all on neutron.* to 'neutron'@'%' identified by '{{ NEUTRON_DBPASS }}';"; - su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron; - when: inventory_hostname == haproxy_hosts.keys()[0] - tags: - - test_odl - diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/02_odl_compute.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/02_odl_compute.yml deleted file mode 100755 index 7506200b..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/02_odl_compute.yml +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: Provision ODL on Compute nodes - include: 03_openvswitch.yml diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_00_switch_off_neutron_openvswitch_agent.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_00_switch_off_neutron_openvswitch_agent.yml deleted file mode 100644 index 50359df4..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_00_switch_off_neutron_openvswitch_agent.yml +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- -- name: remove neutron-openvswitch-agent service daemon - shell: sed -i '/{{ service_ovs_agent_name }}/d' /opt/service ; - -- name: shut down and disable Neutron's openvswitch agent services - service: name={{ service_ovs_agent_name }} state=stopped enabled=no - -- name: remove Neutron's openvswitch agent services - shell: > - update-rc.d -f {{ service_ovs_agent_name }} remove; - mv /etc/init.d/{{ service_ovs_agent_name }} /home/{{ service_ovs_agent_name }}; - mv /etc/init/{{ service_ovs_agent_name }}.conf /home/{{ service_ovs_agent_name }}.conf; - when: ansible_os_family == "Debian" diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_01_clean_up_and_restart_openvswitch.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_01_clean_up_and_restart_openvswitch.yml deleted file mode 100644 index 48287857..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_01_clean_up_and_restart_openvswitch.yml +++ /dev/null @@ -1,16 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: Stop the Open vSwitch service and clear existing OVSDB - shell: > - service {{ service_ovs_name }} stop ; - rm -rf /var/log/openvswitch/* ; - rm -rf /etc/openvswitch/conf.db ; - service {{ service_ovs_name }} start ; diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_03_00_recover_external_network_l3.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_03_00_recover_external_network_l3.yml deleted file mode 100644 index 95b64eeb..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_03_00_recover_external_network_l3.yml +++ /dev/null @@ -1,41 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: check br-ex - shell: ovs-vsctl list-br | grep br-ex; while [ $? -ne 0 ]; do sleep 10; ovs-vsctl list-br | grep br-ex; done - -- name: add ovs uplink - openvswitch_port: bridge=br-ex port={{ item["interface"] }} state=present - with_items: "{{ network_cfg['provider_net_mappings'] }}" - when: item["type"] == "ovs" - -- name: wait 10 seconds - shell: sleep 10 - -- name: set external nic in openvswitch - shell: ovs-vsctl set Open_vSwitch $(ovs-vsctl show | head -n 1) other_config:provider_mappings=br-ex:{{ item["interface"] }} - with_items: "{{ network_cfg['provider_net_mappings'] }}" - when: item["type"] == "ovs" - -- name: copy recovery script - copy: src={{ item }} dest=/opt/setup_networks - with_items: - - recover_network_odl_l3.py - - setup_networks_odl_l3.py - -- name: recover external script - shell: python /opt/setup_networks/recover_network_odl_l3.py - -- name: update keepalived info - template: src=keepalived.conf dest=/etc/keepalived/keepalived.conf - when: inventory_hostname in groups['odl'] - -- name: modify net-init - shell: sed -i 's/setup_networks.py/setup_networks_odl_l3.py/g' /etc/init.d/net_init diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_03_01_recover_external_network_l2.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_03_01_recover_external_network_l2.yml deleted file mode 100644 index 4efe4339..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_03_01_recover_external_network_l2.yml +++ /dev/null @@ -1,27 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: add ovs bridge - openvswitch_bridge: bridge={{ item["name"] }} state=present - with_items: "{{ network_cfg['provider_net_mappings'] }}" - when: item["type"] == "ovs" - -- 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" - -- name: copy recovery script - copy: src={{ item }} dest=/opt/setup_networks - with_items: - - recover_network.py - -- name: recover external script - shell: python /opt/setup_networks/recover_network.py diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_03_recover_external_network.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_03_recover_external_network.yml deleted file mode 100644 index 40963260..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_03_recover_external_network.yml +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: recover external network for L3 - include: 03_03_00_recover_external_network_l3.yml - when: odl_l3_agent == "Enable" - -- name: recover external network for L2 - include: 03_03_01_recover_external_network_l2.yml - when: odl_l3_agent == "Disable" - -- name: restart keepalived to recover external IP - shell: service keepalived restart - when: inventory_hostname in groups['odl'] - ignore_errors: True diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_04_setup_ml2.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_04_setup_ml2.yml deleted file mode 100644 index 24149735..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_04_setup_ml2.yml +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: configure opendaylight -> ml2 - shell: > - crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers opendaylight; - crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types vxlan; - crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ovs enable_tunneling True; - -- name: copy ml2 configuration script - template: - src: ml2_conf.sh - dest: "/opt/ml2_conf.sh" - mode: 0777 - -- name: execute ml2 configuration script - command: su -s /bin/sh -c "/opt/ml2_conf.sh;" diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_openvswitch.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_openvswitch.yml deleted file mode 100755 index f5b2ef3c..00000000 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/03_openvswitch.yml +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- - -- name: switch off neutron-openvswitch-agent - include: 03_00_switch_off_neutron_openvswitch_agent.yml - -- name: clean up and restart openvswitch - include: 03_01_clean_up_and_restart_openvswitch.yml - -- name: openvswitch connect with opendaylight and check br-int - include: 03_02_openvswitch_connect_opendaylight.yml - -- name: recover external network - include: 03_03_recover_external_network.yml - -- name: set up ml2 - include: 03_04_setup_ml2.yml |