aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/odl_cluster/roles/setup-odl/tasks/control-hosts-1.yml
blob: 9ca27e0a85a8fae6793c2a5a370a5b58fe2300ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---

- 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: modify 8181 to 8081
  shell: >
    sed -i 's/8181/8081/'
    {{ odl_home }}etc/org.ops4j.pax.web.cfg

- name: remove karaf data directory
  file:
    path: "{{ odl_home }}data"
    state: absent