blob: 74653996dc202a6ff07274e59bba81ea7e0413bf [file] [log] [blame]
Zack Williams363bc852016-04-12 13:58:29 -07001---
2- hosts: onos-cord-1
3 remote_user: ubuntu
4
5 tasks:
6 - name: Include configuration vars
7 include_vars: onos-setup-vars.yml
8
9 # https://docs.docker.com/engine/installation/linux/ubuntulinux/
10 - name: Prereqs and SSL support for apt for SSL
11 become: yes
12 apt:
13 name={{ item }}
14 update_cache=yes
15 cache_valid_time=3600
16 with_items:
17 - apt-transport-https
18 - ca-certificates
19 - python-pip
20
21 - name: Trust docker apt key
22 become: yes
23 apt_key:
24 keyserver=pool.sks-keyservers.net
25 id=58118E89F3A912897C070ADBF76221572C52609D
26
27 - name: Add docker apt repo
28 become: yes
29 apt_repository:
30 repo="deb https://apt.dockerproject.org/repo ubuntu-trusty main"
31
32 - name: Install docker
33 become: yes
34 apt:
35 update_cache=yes
36 cache_valid_time=3600
37 name=docker-engine
38
39 - name: Make user part of the Docker group
40 become: yes
41 user:
42 name={{ ansible_user_id }}
43 groups="docker" append=yes
44
45 # https://docs.docker.com/compose/install/#install-using-pip
46 - name: Install docker-compose from PyPi
47 become: yes
48 pip:
49 name=docker-compose
50
Zack Williams9b3c3612016-04-14 07:05:30 -070051 - name: Create CORD directory
52 file:
53 path={{ ansible_user_dir }}/cord
54 state=directory
55
Zack Williams363bc852016-04-12 13:58:29 -070056 - name: Copy over SSH keys
57 copy:
58 src=~/.ssh/{{ item }}
59 dest={{ ansible_user_dir }}/cord/{{ item }}
60 owner={{ ansible_user_id }} mode=0600
61 with_items:
62 - id_rsa
63 - id_rsa.pub
64
Zack Williams2a287092016-05-18 13:41:31 -070065 - name: Copy over files to build XOS variant of ONOS
66 copy:
67 src="~/{{ item }}"
68 dest="{{ ansible_user_dir }}/cord/{{ item }}"
69 with_items:
70 - Dockerfile.xos-onos
71 - onos-service
72
Zack Williams363bc852016-04-12 13:58:29 -070073 - name: Copy over docker-compose.yml files
74 copy:
Zack Williams2a287092016-05-18 13:41:31 -070075 src=~/onos-docker-compose.yml
Zack Williams363bc852016-04-12 13:58:29 -070076 dest={{ ansible_user_dir }}/cord/docker-compose.yml
77
Zack Williamsce422142016-05-20 14:18:22 -070078 # become works around group issue
Zack Williamsd31bbc92016-05-20 11:43:18 -070079 - name: Pull docker image for ONOS
Zack Williamsce422142016-05-20 14:18:22 -070080 become: yes
Zack Williamsd31bbc92016-05-20 11:43:18 -070081 command: docker pull onosproject/onos
82