summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/odl_cluster/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/odl_cluster/tasks')
-rw-r--r--deploy/adapters/ansible/roles/odl_cluster/tasks/01_00_download_packages.yml7
-rw-r--r--deploy/adapters/ansible/roles/odl_cluster/tasks/01_03_copy_odl_configuration_files.yml9
-rw-r--r--deploy/adapters/ansible/roles/odl_cluster/tasks/01_04_install_pip_packages.yml19
-rw-r--r--deploy/adapters/ansible/roles/odl_cluster/tasks/01_06_stop_openstack_services.yml20
-rw-r--r--[-rwxr-xr-x]deploy/adapters/ansible/roles/odl_cluster/tasks/01_odl_controller.yml8
-rw-r--r--deploy/adapters/ansible/roles/odl_cluster/tasks/03_02_openvswitch_connect_opendaylight.yml11
-rw-r--r--deploy/adapters/ansible/roles/odl_cluster/tasks/05_set_opendaylight_cluster.yml34
-rw-r--r--[-rwxr-xr-x]deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml4
-rw-r--r--deploy/adapters/ansible/roles/odl_cluster/tasks/moon-odl.yml61
9 files changed, 142 insertions, 31 deletions
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_00_download_packages.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_00_download_packages.yml
index da7356dc..efd359db 100644
--- a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_00_download_packages.yml
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_00_download_packages.yml
@@ -20,10 +20,15 @@
- name: download oracle-jdk8 script file
get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/onos/{{ jdk8_script_name }}" dest=/opt/
-# "
+#"
- name: download odl package
get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/odl/{{ odl_pkg_url }}" dest=/opt/{{ odl_pkg_name }}
+# "
+- name: download odl pip package
+ get_url: url="http://{{ http_server.stdout_lines[0] }}/pip/{{ networking_odl_pkg_name }}" dest=/opt/{{ networking_odl_pkg_name }}
+
+#"
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_03_copy_odl_configuration_files.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_03_copy_odl_configuration_files.yml
index 507d12ce..8d71606f 100644
--- a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_03_copy_odl_configuration_files.yml
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_03_copy_odl_configuration_files.yml
@@ -8,7 +8,7 @@
##############################################################################
---
- name: opendaylight system file
- template:
+ copy:
src: "{{ service_file.src }}"
dest: "{{ service_file.dst }}"
mode: 0755
@@ -44,3 +44,10 @@
template:
src: tomcat-server.xml
dest: "{{ odl_home }}/configuration/tomcat-server.xml"
+
+- name: create tomcat config
+ template:
+ src: jetty.xml
+ dest: "{{ odl_home }}/etc/jetty.xml"
+
+
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_04_install_pip_packages.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_04_install_pip_packages.yml
index 85bb534a..869d264a 100644
--- a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_04_install_pip_packages.yml
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_04_install_pip_packages.yml
@@ -8,8 +8,19 @@
##############################################################################
---
-- name: install odl pip packages
- pip: name={{ item }} state=present
- with_items: odl_pip
-
+- name: patch odl pip package
+ shell: |
+ cd /opt
+ tar xf /opt/{{ networking_odl_pkg_name }}
+ rm -rf /opt/{{ networking_odl_pkg_name }}
+ sed -i 's/^neutron-lib.*/neutron-lib/' networking-odl-2.0.0/requirements.txt
+ tar zcf /opt/{{ networking_odl_pkg_name }} networking-odl-2.0.0
+ rm -rf networking-odl-2.0.0
+ cd -
+- name: odl pip package install
+ shell: |
+ cd /opt
+ pip install {{ networking_odl_pkg_name }}
+ rm -rf {{ networking_odl_pkg_name }}
+ cd -
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_06_stop_openstack_services.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_06_stop_openstack_services.yml
index 8dfaf4df..f44b373b 100644
--- a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_06_stop_openstack_services.yml
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_06_stop_openstack_services.yml
@@ -20,23 +20,3 @@
- name: turn off keepalived on control node
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" and ansible_os_family == "Debian"
-
-- name: remove neutron-l3-agent daemon
- shell: >
- sed -i 'neutron-l3-agent/d' /opt/service ;
- mv /lib/systemd/system/neutron-l3-agent.service /home/ ;
- when: odl_l3_agent == "Enable" and ansible_os_family == "RedHat"
-
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_odl_controller.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_odl_controller.yml
index 7ca38f17..d78a76e0 100755..100644
--- a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_odl_controller.yml
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_odl_controller.yml
@@ -29,6 +29,14 @@
- name: stop openstack services
include: 01_06_stop_openstack_services.yml
+- name: set opendaylight cluster
+ include: 05_set_opendaylight_cluster.yml
+ when: groups['odl']|length > 1
+
+- name: install moon
+ include: moon-odl.yml
+ when: moon == "Enable"
+
- name: start and check odl
include: 01_07_start_check_odl.yml
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/03_02_openvswitch_connect_opendaylight.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/03_02_openvswitch_connect_opendaylight.yml
index c312490b..04f0ec61 100644
--- a/deploy/adapters/ansible/roles/odl_cluster/tasks/03_02_openvswitch_connect_opendaylight.yml
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/03_02_openvswitch_connect_opendaylight.yml
@@ -8,6 +8,16 @@
##############################################################################
---
+- name: restart keepalived to recover external IP before check br-int
+ shell: service keepalived restart
+ when: inventory_hostname in groups['odl']
+ ignore_errors: True
+
+- name: restart opendaylight (for newton, opendaylight doesn't listen 6640 port, need restart)
+ shell: service opendaylight restart; sleep 60
+ when: inventory_hostname in groups['odl']
+ ignore_errors: True
+
- name: set opendaylight as the manager
command: su -s /bin/sh -c "ovs-vsctl set-manager tcp:{{ internal_vip.ip }}:6640;"
@@ -18,4 +28,3 @@
shell: ovs-vsctl set Open_vSwitch $(ovs-vsctl show | head -n 1) other_config={'local_ip'=' {{ internal_ip }} '};
#'
-
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/05_set_opendaylight_cluster.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/05_set_opendaylight_cluster.yml
new file mode 100644
index 00000000..7eddf7fa
--- /dev/null
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/05_set_opendaylight_cluster.yml
@@ -0,0 +1,34 @@
+##############################################################################
+# 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: combine odl controller
+ shell: rm -f /opt/cluster; touch /opt/cluster;
+
+- name: combine odl controller
+ shell: echo "{{ ip_settings[item.1]['mgmt']['ip'] }} \c" >> /opt/cluster; >> /opt/cluster;
+ with_indexed_items: groups['odl']
+
+- name: combine odl controller
+ shell: cat /opt/cluster
+ register: cluster
+
+#- debug: msg="{{ cluster.stdout_lines[0] }}"
+
+- name: combine odl controller
+ shell: uname -n | cut -b 5,5
+ register: number
+
+#- debug: msg="{{ number.stdout_lines[0] }}"
+
+- debug: msg="{{ odl_home }}/bin/configure_cluster.sh {{ number.stdout_lines[0] }} {{ cluster.stdout_lines[0] }}"
+
+- name: configure odl controller in cluster
+ shell: "{{ odl_home }}/bin/configure_cluster.sh {{ number.stdout_lines[0] }} {{ cluster.stdout_lines[0] }}"
+
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml
index 50f40db7..32952c51 100755..100644
--- a/deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml
@@ -22,7 +22,3 @@
- name: Provision ODL on Compute nodes
include: 02_odl_compute.yml
when: groups['odl']|length !=0 and inventory_hostname not in groups['odl']
-
-- name: Config nova
- include: 04_odl_l3_nova.yml
- when: groups['odl']|length !=0 and odl_l3_agent == "Enable"
diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/moon-odl.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/moon-odl.yml
new file mode 100644
index 00000000..b89b2823
--- /dev/null
+++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/moon-odl.yml
@@ -0,0 +1,61 @@
+##############################################################################
+# 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: delete data journal snapshots
+ shell: rm -rf {{ odl_home }}/{{ item }}
+ with_items:
+ - journal
+ - data
+ - snapshots
+
+- name: remove aaa feature
+ shell: rm -rf {{ odl_home }}/system/org/opendaylight/aaa/
+
+- name: download apache maven package file
+ get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/moon/apache-maven-3.3.9-bin.tar.gz" dest=/opt/apache-maven-3.3.9-bin.tar.gz
+
+- name: create maven folder
+ shell: mkdir -p /opt/apache-maven-3.3.9/
+
+- name: extract maven
+ command: su -s /bin/sh -c "tar zxf /opt/apache-maven-3.3.9-bin.tar.gz -C /opt/apache-maven-3.3.9/ --strip-components 1 --no-overwrite-dir -k --skip-old-files" root
+
+- name: install maven
+ shell: ln -s /opt/apache-maven-3.3.9/bin/mvn /usr/local/bin/mvn;
+
+- name: create m2 directory
+ file: path=/root/.m2/ state=directory mode=0755
+
+- name: copy settings.xml
+ template: src=settings.xml dest=/root/.m2/settings.xml
+
+#- name: upload swift lib
+# unarchive: src=odl-aaa-moon.tar.gz dest=/home/
+
+- name: download odl-aaa-moon package
+ get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/moon/{{ odl_aaa_moon }}" dest=/home/
+
+- name: unarchive odl-aaa-moon package
+ command: su -s /bin/sh -c "tar xvf /home/{{ odl_aaa_moon }} -C /home/"
+
+- name: install aaa
+ shell: >
+ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/opt/apache-maven-3.3.3/bin";
+ export JAVA_HOME="/usr/lib/jvm/java-8-oracle";
+ export _JAVA_OPTIONS="-Djava.net.preferIPv4Stack=true";
+ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=512m";
+ cd /home/odl-aaa-moon/aaa/;
+ mvn clean install -DskipTests;
+
+- name: remove shiro ini
+ shell: rm -f {{ odl_home }}/etc/shiro.ini
+
+- name: set moon env
+ template: src=moon-environment dest=/opt/moon-environment