diff options
author | liyuenan <liyuenan@huawei.com> | 2016-12-19 11:06:36 +0800 |
---|---|---|
committer | liyuenan <liyuenan@huawei.com> | 2016-12-20 15:05:03 +0800 |
commit | 819912d0379f6cd2b2693c2968576f7514a117c5 (patch) | |
tree | e24d274484fa1ec8976c9f1bd44f5ee6e445724b /deploy/adapters/ansible/roles/onos_cluster | |
parent | eb5dbdac42b1b7b775fbc1dc513376425a6898ff (diff) |
master only support newton
JIRA: COMPASS-513
Remove other roles and ppa, master only support newton.
Change-Id: I47ddb16baa25902c3e05cc7f9d0d6430f5dc7e00
Signed-off-by: liyuenan <liyuenan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/onos_cluster')
4 files changed, 55 insertions, 113 deletions
diff --git a/deploy/adapters/ansible/roles/onos_cluster/tasks/main.yml b/deploy/adapters/ansible/roles/onos_cluster/tasks/main.yml index 64fff472..c8ce1155 100755 --- a/deploy/adapters/ansible/roles/onos_cluster/tasks/main.yml +++ b/deploy/adapters/ansible/roles/onos_cluster/tasks/main.yml @@ -46,8 +46,6 @@ include: onos_controller.yml when: inventory_hostname in groups['onos'] -- name: Install ONOS Cluster on Compute +- name: Config ONOS Cluster include: openvswitch.yml when: groups['onos']|length !=0 -# when: groups['onos']|length !=0 and inventory_hostname not in groups['onos'] - diff --git a/deploy/adapters/ansible/roles/onos_cluster/tasks/onos_controller.yml b/deploy/adapters/ansible/roles/onos_cluster/tasks/onos_controller.yml index 6d62a2e9..d51151a9 100755 --- a/deploy/adapters/ansible/roles/onos_cluster/tasks/onos_controller.yml +++ b/deploy/adapters/ansible/roles/onos_cluster/tasks/onos_controller.yml @@ -7,25 +7,41 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --- -- name: upload onos driver package - unarchive: src=networking-onos.tar dest=/opt/ + +- name: get image http server + shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf + register: http_server + +- name: download onos driver packages + get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/onos/{{ onos_driver }}" dest=/opt/ + +- name: upload onos sfc driver package + get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/onos/{{ onos_sfc_driver }}" dest=/opt/ + +- name: unarchive onos driver package + command: su -s /bin/sh -c "tar xvf /opt/networking-onos.tar -C /opt/" + +- name: upload onos sfc driver package + command: su -s /bin/sh -c "tar xvf /opt/networking-sfc.tar -C /opt/" - name: install onos driver command: su -s /bin/sh -c "/opt/networking-onos/install_driver.sh" +- name: install onos sfc driver + command: su -s /bin/sh -c "/opt/networking-sfc/install_driver.sh" + - name: install onos required packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: packages -- name: get image http server - shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf - register: http_server - - name: download oracle-jdk8 package file get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/onos/{{ jdk8_pkg_name }}" dest=/opt/{{ jdk8_pkg_name }} - -- name: upload install_jdk8 scripts - unarchive: src=install_jdk8.tar dest=/opt/ + +- name: download oracle-jdk8 script file + get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/onos/{{ jdk8_script_name }}" dest=/opt/ + +- 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" @@ -58,7 +74,7 @@ ignore_errors: True - name: download jar repository - get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/onos/repository.tar" dest=~/.m2/ + get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/onos/{{ repository }}" dest=~/.m2/ - name: extract jar repository command: su -s /bin/sh -c "tar xvf ~/.m2/repository.tar -C ~/.m2/" @@ -75,47 +91,19 @@ sed -i '/pre-stop/i\env JAVA_HOME=/usr/lib/jvm/java-8-oracle' {{ onos_home }}/init/onos.conf; cp -rf {{ onos_home }}/init/onos.conf /etc/init/; cp -rf {{ onos_home }}/init/onos.conf /etc/init.d/; -# notify: -# - restart onos service - + - name: configure onos boot feature shell: > sed -i '/^featuresBoot=/c\featuresBoot={{ onos_boot_features }}' {{ onos_home }}/{{ karaf_dist }}/etc/org.apache.karaf.features.cfg; -#- name: create cluster json -# template: -# src: cluster.json -# dest: "{{ onos_home }}/config/cluster.json" -# notify: -# - restart onos service - -#- name: create tablets json -# template: -# src: tablets.json -# dest: "{{ onos_home }}/config/tablets.json" -# notify: -# - restart onos service - - name: wait for config time shell: "sleep 10" - name: start onos service service: name=onos state=started enabled=yes -- name: wait for restart time - shell: "sleep 60" - -- name: start onos service - service: name=onos state=restarted enabled=yes - - name: wait for onos start time - shell: "sleep 60" - -- name: start onos service - service: name=onos state=restarted enabled=yes - -- name: wait for onos start time - shell: "sleep 100" + shell: "sleep 200" - name: add onos auto start shell: > @@ -124,12 +112,9 @@ ########################################################################################################## ################################ ONOS connect with OpenStack ################################ ########################################################################################################## -#- name: Run OpenVSwitch Script -# include: openvswitch.yml - - name: Configure Neutron1 shell: > - crudini --set /etc/neutron/neutron.conf DEFAULT service_plugins onos_router; + crudini --set /etc/neutron/neutron.conf DEFAULT service_plugins networking_sfc.services.sfc.plugin.SfcPlugin, networking_sfc.services.flowclassifier.plugin.FlowClassifierPlugin, onos_router; crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers onos_ml2; crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types vxlan; crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers vxlan @@ -143,13 +128,13 @@ - name: Configure Neutron2 command: su -s /bin/sh -c "/opt/ml2_conf.sh;" - - name: Configure Neutron3 shell: > mysql -e "drop database if exists neutron_ml2;"; mysql -e "create database neutron_ml2 character set utf8;"; mysql -e "grant all on neutron_ml2.* to 'neutron'@'%';"; 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; + su -s /bin/sh -c "neutron-db-manage --subproject networking-sfc upgrade head" neutron; - name: Restart neutron-server service: name=neutron-server state=restarted diff --git a/deploy/adapters/ansible/roles/onos_cluster/tasks/openvswitch.yml b/deploy/adapters/ansible/roles/onos_cluster/tasks/openvswitch.yml index 47f0f6e8..aac787ea 100755 --- a/deploy/adapters/ansible/roles/onos_cluster/tasks/openvswitch.yml +++ b/deploy/adapters/ansible/roles/onos_cluster/tasks/openvswitch.yml @@ -7,38 +7,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --- -#- name: remove neutron-plugin-openvswitch-agent auto start -# shell: > -# update-rc.d neutron-plugin-openvswitch-agent remove; -# sed -i /neutron-plugin-openvswitch-agent/d /opt/service -#- name: shut down and disable Neutron's agent services -# service: name=neutron-plugin-openvswitch-agent state=stopped - -#- name: Stop the Open vSwitch service and clear existing OVSDB -# shell: > -# ovs-vsctl del-br br-int ; -# ovs-vsctl del-br br-tun ; -# ovs-vsctl del-manager ; - -#- name: get image http server -# shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf -# register: http_server -# -#- name: download ovs -# get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/onos/openvswitch.tar" dest=/opt/openvswitch.tar -# -#- name: extract ovs -# command: su -s /bin/sh -c "tar xvf /opt/openvswitch.tar -C /opt/" -# -#- name: update ovs -# shell: > -# cd /opt/openvswitch; -# dpkg -i openvswitch-common_2.3.0-1_amd64.deb; -# dpkg -i openvswitch-switch_2.3.0-1_amd64.deb; - -#- name: start up onos-external nic -# command: su -s /bin/sh -c "ifconfig eth2 0 up" - name: set veth port shell: > ip link add onos_port1 type veth peer name onos_port2; @@ -46,26 +15,28 @@ ifconfig onos_port2 up; ignore_errors: True -- name: set veth to ovs - shell: > - export externamMac=`ifconfig eth1 | grep -Eo '\<[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'`; - ifconfig onos_port2 hw ether $externamMac; - ovs-vsctl add-port br-prv onos_port1; - ignore_errors: True +- name: add openflow-base feature + command: su -s /bin/sh -c "/opt/onos/bin/onos 'feature:install onos-openflow-base'"; + when: inventory_hostname in groups['onos'] -#- name: wait for onos start time -# shell: "sleep 200" +- name: add openflow feature + command: su -s /bin/sh -c "/opt/onos/bin/onos 'feature:install onos-openflow'"; + when: inventory_hostname in groups['onos'] - name: add ovsdatabase feature command: su -s /bin/sh -c "/opt/onos/bin/onos 'feature:install onos-ovsdatabase'"; - when: inventory_hostname == groups['onos'][0] + when: inventory_hostname in groups['onos'] -- name: add openflow-base feature - command: su -s /bin/sh -c "/opt/onos/bin/onos 'feature:install onos-openflow-base'"; +- name: add ovsdb-base feature + command: su -s /bin/sh -c "/opt/onos/bin/onos 'feature:install onos-ovsdb-base'"; when: inventory_hostname in groups['onos'] -- name: add openflow feature - command: su -s /bin/sh -c "/opt/onos/bin/onos 'feature:install onos-openflow'"; +- name: add onos driver ovsdb feature + command: su -s /bin/sh -c "/opt/onos/bin/onos 'feature:install onos-drivers-ovsdb'"; + when: inventory_hostname in groups['onos'] + +- name: add ovsdb provider host feature + command: su -s /bin/sh -c "/opt/onos/bin/onos 'feature:install onos-ovsdb-provider-host'"; when: inventory_hostname in groups['onos'] - name: add vtn feature @@ -79,23 +50,6 @@ - name: Set ONOS as the manager command: su -s /bin/sh -c "ovs-vsctl set-manager tcp:{{ ip_settings[groups['onos'][0]]['mgmt']['ip'] }}:6640;" -- name: create public network - shell: > - export OS_PASSWORD=console; - export OS_TENANT_NAME=admin; - export OS_AUTH_URL=http://{{ internal_vip.ip }}:35357/v2.0; - export OS_USERNAME=ADMIN; - neutron net-create ext-net --shared --router:external=True; - neutron subnet-create ext-net {{ public_net_info.floating_ip_cidr }} --name ext-subnet --allocation-pool start={{ public_net_info.floating_ip_start }},end={{ public_net_info.floating_ip_end }}; - when: inventory_hostname == groups['controller'][0] - -- name: set gateway mac address - shell: > - ping -c 1 {{ ansible_default_ipv4.gateway }}; - gatewayMac=`arp -a {{ ansible_default_ipv4.gateway }} | awk '{print $4}'`; - /opt/onos/bin/onos "externalgateway-update -m $gatewayMac"; - when: inventory_hostname in groups['onos'] - - name: delete default gateway shell: > route delete default; diff --git a/deploy/adapters/ansible/roles/onos_cluster/vars/main.yml b/deploy/adapters/ansible/roles/onos_cluster/vars/main.yml index 1cbc070d..f11f1102 100755 --- a/deploy/adapters/ansible/roles/onos_cluster/vars/main.yml +++ b/deploy/adapters/ansible/roles/onos_cluster/vars/main.yml @@ -6,9 +6,14 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -onos_pkg_url: http://downloads.onosproject.org/release/onos-1.3.0.tar.gz -onos_pkg_name: onos-1.3.0.tar.gz +onos_pkg_name: onos-1.6.0.tar.gz onos_home: /opt/onos/ -karaf_dist: apache-karaf-3.0.3 +karaf_dist: apache-karaf-3.0.5 jdk8_pkg_name: jdk-8u51-linux-x64.tar.gz -onos_boot_features: config,standard,region,package,kar,ssh,management,webconsole,onos-api,onos-core,onos-incubator,onos-cli,onos-rest,onos-gui,onos-openflow-base,onos-openflow,onos-ovsdatabase, onos-app-vtn-onosfw +jdk8_script_name: install_jdk8.tar +onos_driver: networking-onos.tar +onos_sfc_driver: networking-sfc.tar +repository: repository.tar +onos_boot_features: config,standard,region,package,kar,ssh,management,webconsole,onos-api,onos-core,onos-incubator,onos-cli,onos-rest,onos-gui,onos-openflow-base, onos-openflow, onos-ovsdatabase, onos-ovsdb-base, onos-drivers-ovsdb, onos-ovsdb-provider-host, onos-app-vtn-onosfw + + |