diff options
author | Yifei Xue <xueyifei@huawei.com> | 2017-06-19 19:22:11 +0800 |
---|---|---|
committer | Yifei Xue <xueyifei@huawei.com> | 2017-07-10 10:42:20 +0000 |
commit | a7fed3be428eddf64f626c52ef35cf691c68e431 (patch) | |
tree | 4fe6b4cf635cd3ebf3450dd97fa0e947d47ae92c /plugins/odl_cluster/tasks/control-hosts-1.yml | |
parent | 4db2df5989e16b2ad1152b7851136ff4dc637252 (diff) |
Upgrade ODL from boron to carbon
JIRA: -
Change-Id: I031444d1094af646ae39a9c0c3fbfc30548e6ee4
Signed-off-by: Yifei Xue <xueyifei@huawei.com>
Diffstat (limited to 'plugins/odl_cluster/tasks/control-hosts-1.yml')
-rw-r--r-- | plugins/odl_cluster/tasks/control-hosts-1.yml | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/plugins/odl_cluster/tasks/control-hosts-1.yml b/plugins/odl_cluster/tasks/control-hosts-1.yml new file mode 100644 index 00000000..133d98a7 --- /dev/null +++ b/plugins/odl_cluster/tasks/control-hosts-1.yml @@ -0,0 +1,98 @@ +--- + +- name: check sdn_package cache + stat: + path=/opt/sdn_package.tar.gz + register: sdn_cache # Todo: remove hard code and add md5 check + +- name: debug + debug: msg="{{ sdn_cache }}" + +- name: get sdn_package + get_url: + url: "{{ sdn_package }}" + dest: /opt/ + when: sdn_cache.stat.exists != 'true' + +- 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" + +- name: clear sdn_package + command: su -s /bin/sh -c "rm -rf /opt/sdn_package" + +- name: clear jdk8 package + command: su -s /bin/sh -c "rm -rf /opt/install_jdk8" + +- name: unarchive sdn_package + command: su -s /bin/sh -c "tar xzf /opt/sdn_package.tar.gz -C /opt/" + +- name: copy java package + command: su -s /bin/sh -c "cp /opt/sdn_package/java/jdk-8u51-linux-x64.tar.gz /opt/" + +- name: unarchive java_install package + command: su -s /bin/sh -c "tar xvf /opt/sdn_package/java/install_jdk8.tar -C /opt/" + +- name: install java + command: su -s /bin/sh -c "/opt/install_jdk8/install_jdk8.sh" + +- name: clear odl package + command: su -s /bin/sh -c "rm -rf {{ odl_home }}*" + +- name: extract odl package + command: | + su -s /bin/sh -c "tar xzf /opt/sdn_package/odl/{{ odl_pkg_name }} -C {{ odl_home }} \ + --strip-components 1" odl + +- name: opendaylight system file + copy: + src: "{{ service_file.src }}" + dest: "{{ service_file.dst }}" + mode: 0755 + +- name: set l3 fwd enable in custom.properties + template: + src: custom.properties + dest: "{{ odl_home }}/etc/custom.properties" + owner: odl + group: odl + mode: 0775 + when: odl_l3_agent == "Enable" + +- name: create karaf config + template: + src: org.apache.karaf.features.cfg + dest: "{{ odl_home }}/etc/org.apache.karaf.features.cfg" + owner: odl + group: odl + mode: 0775 + +- name: copy acl configuration script + template: + src: acl_conf.sh + dest: "/opt/acl_conf.sh" + mode: 0777 + +- name: execute acl configuration script + command: su -s /bin/sh -c "/opt/acl_conf.sh;" odl + +- name: create jetty config + shell: > + sed -i 's/default="8181"/default="8081"/' + {{ odl_home }}etc/jetty.xml + +- name: create tomcat config + shell: > + sed -i 's/port="8282"/port="8081"/' + {{ odl_home }}configuration/tomcat-server.xml + +- name: remove karaf data directory + shell: rm -rf {{ odl_home }}/data/*; |