blob: 45f66000f21c8598d32adef5b3cc2497959b9d65 [file] [log] [blame]
Luca Prete8d4e8bc2016-08-24 14:49:54 -07001---
2#
Luca Preted8d82312017-03-23 10:26:16 -07003# Installs ONOS and downloads the related dependencies.
Luca Prete8d4e8bc2016-08-24 14:49:54 -07004#
Luca Prete8d4e8bc2016-08-24 14:49:54 -07005- name: Cloning ONOS repository
6 git:
7 repo: "{{ onos_repo_url }}"
Luca Preted8d82312017-03-23 10:26:16 -07008 dest: "{{ onos_dir }}"
9 version: "onos-{{ onos_version }}"
Luca Prete8d4e8bc2016-08-24 14:49:54 -070010
11- name: Changing ONOS repository permissions
12 file:
13 path: "/home/ubuntu/onos"
14 state: directory
15 owner: ubuntu
16 group: ubuntu
17 mode: 0777
18
19- name: Exporting ONOS variables
20 lineinfile:
21 dest: /home/ubuntu/.bashrc
22 line: "{{ item }}"
23 with_items: "{{ onos_variables }}"
24
25- name: Compiling ONOS
26 shell: "{{ item }}"
27 args:
Luca Preted8d82312017-03-23 10:26:16 -070028 chdir: "/home/ubuntu/onos/tools/build"
Luca Prete8d4e8bc2016-08-24 14:49:54 -070029 with_items:
Luca Preted8d82312017-03-23 10:26:16 -070030 - "./onos-buck build onos"
Luca Prete8d4e8bc2016-08-24 14:49:54 -070031
32- name: Creating 1 node ONOS cell
33 template:
34 src: templates/one_node_cell.j2
35 dest: "{{ cell_files[0] }}"
36 owner: ubuntu
37 group: ubuntu
38 mode: 0777
39
40- name: Creating 3 node ONOS cell
41 template:
42 src: templates/three_node_cell.j2
43 dest: "{{ cell_files[1] }}"
44 owner: ubuntu
45 group: ubuntu
46 mode: 0777
47
48- name: Creating ONOS deployment script
49 template:
50 src: templates/onos_deploy.j2
51 dest: "/home/ubuntu/onos_deploy.sh"
52 owner: ubuntu
53 group: ubuntu
54 mode: 0777
55
Luca Preted8d82312017-03-23 10:26:16 -070056- name: Changing ONOS repository permissions
57 file:
58 path: "/home/ubuntu/onos"
59 state: directory
60 owner: ubuntu
61 group: ubuntu
62 mode: 0777
63
64- name: Changing /tmp/stc dir permissions
65 file:
66 path: "/tmp/stc"
67 state: directory
68 owner: ubuntu
69 group: ubuntu
70 mode: 0777
71
Luca Prete8d4e8bc2016-08-24 14:49:54 -070072- name: Deploying ONOS
Luca Preted8d82312017-03-23 10:26:16 -070073 become: yes
74 become_user: ubuntu
Luca Prete8d4e8bc2016-08-24 14:49:54 -070075 shell: "/home/ubuntu/onos_deploy.sh"
76 environment:
77 ONOS_ROOT: /home/ubuntu/onos
78 args:
79 executable: /bin/bash
Luca Prete8d4e8bc2016-08-24 14:49:54 -070080
81- name: Adding ONOS to startup
82 become: yes
83 shell: "lxc-attach --name {{ item.value.name }} -- systemctl enable onos"
84 with_dict: "{{ lxc }}"