-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_onos.yml
87 lines (69 loc) · 2.39 KB
/
build_onos.yml
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
---
- name: Set enviroment on build machine
hosts: localhost
tasks:
- name: Add PPA
become: yes
apt_repository: repo='ppa:webupd8team/java'
- name: Accept Java 8 License
become: yes
debconf: name='oracle-java8-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select'
- name: Install packages
become: yes
apt: name={{item}} update_cache=yes
with_items:
- git
- oracle-java8-installer
- oracle-java8-set-default
- name: Put source file
copy: src=init-onos dest=~/init-onos
- name: Pull ONOS
git: repo=https://github.com/opennetworkinglab/onos.git dest=~/onos
- name: Put cell file
copy: src=cell dest=~/onos/tools/test/cells/cell
- name: Download Apache Karaf 3.0.5
command: 'wget ftp://140.113.169.97/apache-karaf-3.0.5.tar.gz -P ~/Downloads/'
- name: Download Apache Maven 3.3.9
command: 'wget ftp://140.113.169.97/apache-maven-3.3.9-bin.tar.gz -P ~/Downloads/'
- name: Create Application Director
file: path=~/Applications state=directory mode=0775
- name: Unarchive Apache Karaf 3.0.5
unarchive: src=~/Downloads/apache-karaf-3.0.5.tar.gz dest=~/Applications
- name: Unarchive Apache Maven 3.3.9
unarchive: src=~/Downloads/apache-maven-3.3.9-bin.tar.gz dest=~/Applications
- name: Compile ONOS
shell: source ~/init-onos && cd ~/onos && mvn clean install
args:
executable: /bin/bash
register: result
changed_when: "'[INFO] BUILD SUCCESS' in result.stdout_lines"
- name: Packing ONOS
shell: source ~/init-onos && onos-package
args:
executable: /bin/bash
# - local_action: copy content={{ result }} dest=~/file
- name: Set enviroment on remote site
hosts: onos
tasks:
- name: Add PPA
become: yes
apt_repository: repo='ppa:webupd8team/java'
- name: Accept Java 8 License
become: yes
debconf: name='oracle-java8-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select'
- name: Install packages
become: yes
apt: name={{item}} update_cache=yes
with_items:
- git
- oracle-java8-installer
- oracle-java8-set-default
- name: Deploy ONOS instance
hosts: localhost
tasks:
- name: Deploy ONOS instance
shell: source ~/init-onos && stc setup
args:
executable: /bin/bash
register: push_result
- local_action: copy content={{ push_result }} dest=~/push_file