blob: ba88406f44fc6bcb93652ca1cab507e07baa680f [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 SSL Certs so docker-compose can find it
Zack Williams670e00c2016-05-18 18:53:54 -070066 command: cp /usr/local/share/ca-certificates/keystone_juju_ca_cert.crt {{ ansible_user_dir }}/cord/xos-certs.crt
Zack Williams2e5d51a2016-05-18 16:45:22 -070067 creates="{{ ansible_user_dir }}/cord/xos-certs.crt"
Zack Williams2a287092016-05-18 13:41:31 -070068
69 - name: Copy over files to build XOS variant of ONOS
70 copy:
71 src="~/{{ item }}"
72 dest="{{ ansible_user_dir }}/cord/{{ item }}"
73 with_items:
74 - Dockerfile.xos-onos
75 - onos-service
76
Zack Williams363bc852016-04-12 13:58:29 -070077 - name: Copy over docker-compose.yml files
78 copy:
Zack Williams2a287092016-05-18 13:41:31 -070079 src=~/onos-docker-compose.yml
Zack Williams363bc852016-04-12 13:58:29 -070080 dest={{ ansible_user_dir }}/cord/docker-compose.yml
81