From 98af56663a79c9fba053cb7e0a312de42bbfa1ef Mon Sep 17 00:00:00 2001 From: "chenshuai@huawei.com" Date: Fri, 5 Aug 2016 02:29:52 -0400 Subject: add moon to opendaylight JIRA: COMPASS-463 Change-Id: I9b3c3fb3377df34004fe78eccc70b28402997949 Signed-off-by: chenshuai@huawei.com --- .../roles/odl_cluster/tasks/moon-odl.yml | 58 ++++++++++++++++++++++ .../roles/odl_cluster/tasks/odl_controller.yml | 10 ++++ deploy/conf/vm_environment/os-odl_l2-moon-ha.yml | 31 ++++++++++++ deploy/conf/vm_environment/os-odl_l2-moon-noha.yml | 31 ------------ 4 files changed, 99 insertions(+), 31 deletions(-) create mode 100644 deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/moon-odl.yml create mode 100644 deploy/conf/vm_environment/os-odl_l2-moon-ha.yml delete mode 100644 deploy/conf/vm_environment/os-odl_l2-moon-noha.yml diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/moon-odl.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/moon-odl.yml new file mode 100644 index 00000000..a2ad56c2 --- /dev/null +++ b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/moon-odl.yml @@ -0,0 +1,58 @@ +############################################################################## +# 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/odl/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: 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 + shell: > + export MOON_SERVER_ADDR={{ internal_vip.ip }}; + export MOON_SERVER_PORT=5000; + export no_proxy="localhost,127.0.0.1"; diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/odl_controller.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/odl_controller.yml index d4fa36fb..9de5f478 100755 --- a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/odl_controller.yml +++ b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/odl_cluster/tasks/odl_controller.yml @@ -209,6 +209,16 @@ service: name=keepalived state=stopped when: ansible_os_family == "Debian" + +################################################################# +########################### moon ################################ +################################################################# + +- include: moon-odl.yml + when: moon == "Enable" + +################################################################# + - name: chown opendaylight directory and files shell: > chown -R odl:odl "{{ odl_home }}"; diff --git a/deploy/conf/vm_environment/os-odl_l2-moon-ha.yml b/deploy/conf/vm_environment/os-odl_l2-moon-ha.yml new file mode 100644 index 00000000..e689875b --- /dev/null +++ b/deploy/conf/vm_environment/os-odl_l2-moon-ha.yml @@ -0,0 +1,31 @@ +TYPE: virtual +FLAVOR: cluster + +moon: "Enable" + +hosts: + - name: host1 + roles: + - controller + - ha + - odl + + - name: host2 + roles: + - controller + - ha + - odl + + - name: host3 + roles: + - controller + - ha + - odl + + - name: host4 + roles: + - compute + + - name: host5 + roles: + - compute diff --git a/deploy/conf/vm_environment/os-odl_l2-moon-noha.yml b/deploy/conf/vm_environment/os-odl_l2-moon-noha.yml deleted file mode 100644 index e689875b..00000000 --- a/deploy/conf/vm_environment/os-odl_l2-moon-noha.yml +++ /dev/null @@ -1,31 +0,0 @@ -TYPE: virtual -FLAVOR: cluster - -moon: "Enable" - -hosts: - - name: host1 - roles: - - controller - - ha - - odl - - - name: host2 - roles: - - controller - - ha - - odl - - - name: host3 - roles: - - controller - - ha - - odl - - - name: host4 - roles: - - compute - - - name: host5 - roles: - - compute -- cgit 1.2.3-korg