aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/odl_sfc/roles/odl_cluster_sfc/tasks/control-hosts-1.yml
diff options
context:
space:
mode:
authorYifei Xue <xueyifei@huawei.com>2017-07-27 20:34:52 +0800
committerJustin chi <chigang@huawei.com>2017-07-28 11:26:55 +0000
commit5388c0cfd7aaee3a877906fd66a519e60bf5fc87 (patch)
tree04f6ffda3efaa9b1d3af82bd6854dbd22966b565 /plugins/odl_sfc/roles/odl_cluster_sfc/tasks/control-hosts-1.yml
parent0a652316917f1e7632e2c3e54d508989a2c754fa (diff)
Add ODL SFC support
Add SFC support for Ocata and Carbon. 1. Add ovs-nsh package for sfc scenario 2. Add sfc configuration and tasks 3. Add sfc DHA files Change-Id: Icf8f20220a2c5ac38a5b92d3ca0e24cbb0e89a52 Signed-off-by: Yifei Xue <xueyifei@huawei.com>
Diffstat (limited to 'plugins/odl_sfc/roles/odl_cluster_sfc/tasks/control-hosts-1.yml')
-rw-r--r--plugins/odl_sfc/roles/odl_cluster_sfc/tasks/control-hosts-1.yml100
1 files changed, 100 insertions, 0 deletions
diff --git a/plugins/odl_sfc/roles/odl_cluster_sfc/tasks/control-hosts-1.yml b/plugins/odl_sfc/roles/odl_cluster_sfc/tasks/control-hosts-1.yml
new file mode 100644
index 00000000..6879340e
--- /dev/null
+++ b/plugins/odl_sfc/roles/odl_cluster_sfc/tasks/control-hosts-1.yml
@@ -0,0 +1,100 @@
+---
+
+- 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
+ file:
+ path: "{{ odl_home }}data"
+ state: absent