From 860506c03cf20ea27121a2031a3d81d0170b1f54 Mon Sep 17 00:00:00 2001 From: "chenshuai@huawei.com" Date: Wed, 9 Sep 2015 05:24:11 -0400 Subject: Support OpenDayLight Lithium deployment JIRA: COMPASS-35 Change-Id: I54763234ff4d708ae97e553372dd601fe9ea6fd4 Signed-off-by: chenshuai@huawei.com --- .../roles/odl_cluster/files/install_jdk8.tar | Bin 0 -> 4608 bytes .../ansible/roles/odl_cluster/handlers/main.yml | 0 .../ansible/roles/odl_cluster/tasks/main.yml | 6 ++-- .../roles/odl_cluster/tasks/odl_controller.yml | 32 +++++++++++++++------ .../roles/odl_cluster/tasks/openvswitch.yml | 32 +++++++++++++++------ .../ansible/roles/odl_cluster/templates/akka.conf | 0 .../roles/odl_cluster/templates/ml2_conf.sh | 0 .../roles/odl_cluster/templates/module-shards.conf | 0 .../roles/odl_cluster/templates/opendaylight.conf | 9 +++--- .../odl_cluster/templates/opendaylight.service | 0 .../templates/org.apache.karaf.features.cfg | 0 .../roles/odl_cluster/templates/tomcat-server.xml | 0 .../ansible/roles/odl_cluster/vars/Debian.yml | 7 +++-- .../ansible/roles/odl_cluster/vars/RedHat.yml | 12 +++++--- .../ansible/roles/odl_cluster/vars/main.yml | 5 +++- 15 files changed, 71 insertions(+), 32 deletions(-) create mode 100755 deploy/adapters/ansible/roles/odl_cluster/files/install_jdk8.tar mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/handlers/main.yml mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/tasks/openvswitch.yml mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/templates/akka.conf mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/templates/ml2_conf.sh mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/templates/module-shards.conf mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.conf mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.service mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/templates/org.apache.karaf.features.cfg mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/templates/tomcat-server.xml mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/vars/Debian.yml mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml mode change 100644 => 100755 deploy/adapters/ansible/roles/odl_cluster/vars/main.yml (limited to 'deploy/adapters/ansible/roles') diff --git a/deploy/adapters/ansible/roles/odl_cluster/files/install_jdk8.tar b/deploy/adapters/ansible/roles/odl_cluster/files/install_jdk8.tar new file mode 100755 index 00000000..faaaeb39 Binary files /dev/null and b/deploy/adapters/ansible/roles/odl_cluster/files/install_jdk8.tar differ diff --git a/deploy/adapters/ansible/roles/odl_cluster/handlers/main.yml b/deploy/adapters/ansible/roles/odl_cluster/handlers/main.yml old mode 100644 new mode 100755 diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml old mode 100644 new mode 100755 index 5c6805c0..37dc1bd1 --- a/deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/main.yml @@ -2,9 +2,9 @@ - include_vars: "{{ ansible_os_family }}.yml" - name: Install ODL Cluster on Controller - include: main_controller.yml - when: inventory_hostname in groups['controller'] + include: odl_controller.yml + when: inventory_hostname in groups['odl'] - name: Install ODL Cluster on Compute - include: main_compute.yml + include: openvswitch.yml when: groups['odl']|length !=0 and inventory_hostname not in groups['odl'] diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml old mode 100644 new mode 100755 index ea90b84e..e2af1459 --- a/deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/odl_controller.yml @@ -1,7 +1,21 @@ --- -- name: install java packages + +- name: install controller packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" - with_items: packages | union(packages_noarch) + with_items: controller_packages | union(controller_packages_noarch) + +- 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: install install_jdk8 package + command: su -s /bin/sh -c "/opt/install_jdk8/install_jdk8.sh" #- name: install opendaylight packages # apt: name={{ item }} state=present @@ -28,9 +42,9 @@ system: "yes" shell: "/bin/false" -- name: get image http server - shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf - register: http_server +#- name: get image http server +# shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf +# register: http_server - name: download odl package get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/odl/{{ odl_pkg_url }}" dest=/opt/{{ odl_pkg_name }} @@ -142,10 +156,10 @@ - name: Turn off neutron-server on control node service: name=neutron-server state=stopped -- name: Install Crudini - apt: name={{ item }} state=present - with_items: - - crudini +#- name: Install Crudini +# apt: name={{ item }} state=present +# with_items: +# - crudini - name: Run OpenVSwitch Script include: openvswitch.yml diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/openvswitch.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/openvswitch.yml old mode 100644 new mode 100755 index e59ca37e..33ab6841 --- a/deploy/adapters/ansible/roles/odl_cluster/tasks/openvswitch.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/openvswitch.yml @@ -1,16 +1,25 @@ --- -- name: Install Crudini - apt: name={{ item }} state=present - with_items: - - crudini +#- name: Install Crudini +# apt: name={{ item }} state=present +# with_items: +# - crudini + +- name: install compute packages + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + with_items: compute_packages | union(compute_packages_noarch) + +- 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: remove Neutron's openvswitch agent services - shell: > - update-rc.d neutron-plugin-openvswitch-agent remove +#- 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: > @@ -22,14 +31,19 @@ - name: Set OpenDaylight as the manager command: su -s /bin/sh -c "ovs-vsctl set-manager tcp:{{ HA_VIP }}:6640;" -- name: start and disable Neutron's agent services - service: name=neutron-plugin-openvswitch-agent state=started +#- name: start and disable Neutron's agent services +# service: name=neutron-plugin-openvswitch-agent state=started - name: Configure Neutron1 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 vlan; +#- name: Adjust Service Daemon +# shell: > +# sed -i '/neutron-plugin-openvswitch-agent/d' /opt/service ; +# echo opendaylight >> /opt/service ; + - name: Create ML2 Configuration File template: src: ml2_conf.sh diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/akka.conf b/deploy/adapters/ansible/roles/odl_cluster/templates/akka.conf old mode 100644 new mode 100755 diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/ml2_conf.sh b/deploy/adapters/ansible/roles/odl_cluster/templates/ml2_conf.sh old mode 100644 new mode 100755 diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/module-shards.conf b/deploy/adapters/ansible/roles/odl_cluster/templates/module-shards.conf old mode 100644 new mode 100755 diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.conf b/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.conf old mode 100644 new mode 100755 index c9a36f2e..d04cac22 --- a/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.conf +++ b/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.conf @@ -6,11 +6,12 @@ author "mskalski@miranits.com" start on runlevel [2345] stop on runlevel [!2345] -setgid odl -setuid odl +#setgid odl +#setuid odl env KARAF_HOME="/opt/opendaylight-0.3.0" -env JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64" +#env JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64" +env JAVA_HOME="/usr/lib/jvm/java-8-oracle" env JAVA_OPTS="-server -Xms128M -Xmx4096M -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:MaxPermSize=512M -Dcom.sun.management.jmxremote" env OPTS="-Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true" env MAIN="org.apache.karaf.main.Main" @@ -35,6 +36,6 @@ script fi done - exec /usr/bin/java $JAVA_OPTS -Djava.endorsed.dirs="${JAVA_ENDORSED_DIRS}" -Djava.ext.dirs="${JAVA_EXT_DIRS}" -Dkaraf.instances="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Dkaraf.data="$KARAF_DATA" -Dkaraf.etc="$KARAF_ETC" -Djava.io.tmpdir="$KARAF_DATA/tmp" -Djava.util.logging.config.file="$KARAF_BASE/etc/java.util.logging.properties" $KARAF_OPTS $OPTS -classpath "$CLASSPATH" $MAIN + exec $JAVA_HOME/bin/java $JAVA_OPTS -Djava.endorsed.dirs="${JAVA_ENDORSED_DIRS}" -Djava.ext.dirs="${JAVA_EXT_DIRS}" -Dkaraf.instances="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Dkaraf.data="$KARAF_DATA" -Dkaraf.etc="$KARAF_ETC" -Djava.io.tmpdir="$KARAF_DATA/tmp" -Djava.util.logging.config.file="$KARAF_BASE/etc/java.util.logging.properties" $KARAF_OPTS $OPTS -classpath "$CLASSPATH" $MAIN end script diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.service b/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.service old mode 100644 new mode 100755 diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/org.apache.karaf.features.cfg b/deploy/adapters/ansible/roles/odl_cluster/templates/org.apache.karaf.features.cfg old mode 100644 new mode 100755 diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/tomcat-server.xml b/deploy/adapters/ansible/roles/odl_cluster/templates/tomcat-server.xml old mode 100644 new mode 100755 diff --git a/deploy/adapters/ansible/roles/odl_cluster/vars/Debian.yml b/deploy/adapters/ansible/roles/odl_cluster/vars/Debian.yml old mode 100644 new mode 100755 index a2a4795c..9f31190f --- a/deploy/adapters/ansible/roles/odl_cluster/vars/Debian.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/vars/Debian.yml @@ -1,7 +1,10 @@ --- -packages: - - openjdk-7-jdk +controller_packages: +# - openjdk-7-jdk + - crudini + +compute_packages: - crudini service_file: diff --git a/deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml b/deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml old mode 100644 new mode 100755 index 8becb8b6..c0dfede1 --- a/deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml @@ -1,9 +1,13 @@ --- -packages: - - java-1.7.0-openjdk +controller_packages: +# - java-1.7.0-openjdk - crudini +compute_packages: + - crudini + + service_file: - - src: opendaylight.service - dst: /usr/lib/systemd/system/opendaylight.service + src: opendaylight.service + dst: /usr/lib/systemd/system/opendaylight.service diff --git a/deploy/adapters/ansible/roles/odl_cluster/vars/main.yml b/deploy/adapters/ansible/roles/odl_cluster/vars/main.yml old mode 100644 new mode 100755 index 73a3b02e..450ee0d0 --- a/deploy/adapters/ansible/roles/odl_cluster/vars/main.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/vars/main.yml @@ -12,4 +12,7 @@ odl_extra_features: ['odl-restconf-all','odl-mdsal-clustering','odl-openflowplug odl_features: "{{ odl_base_features + odl_extra_features }}" odl_api_port: 8080 -packages_noarch: [] +jdk8_pkg_name: jdk-8u51-linux-x64.tar.gz + +controller_packages_noarch: [] +compute_packages_noarch: [] -- cgit 1.2.3-korg