blob: 441dc07bdea3311f5c245e26de347cd99d73c176 [file] [log] [blame]
Scott Baker58e88a82016-11-18 13:39:09 -08001---
2# Common ONOS setup
3
4# onos_cord_dest: {{ ansible_user_dir }}/onos-cord/
5
6- name: Pull docker image for ONOS
7 become: yes
8 command: "docker pull {{ onos_docker_image }}"
9 tags:
10 - skip_ansible_lint # Should replace with http://docs.ansible.com/ansible/docker_module.html, when replacements are stable
11
12- name: Create dest directory
13 file: path="{{ onos_cord_dest }}" state=directory
14
15- name: Copy over SSH key
16 copy:
17 remote_src: True
18 src: "{{ node_private_key }}"
19 dest: "{{ onos_cord_dest }}/node_key"
20 owner: "{{ ansible_user_id }}"
21 mode: 0600
22
23- name: Create templated ONOS files
24 template:
25 src: "{{ item }}.j2"
26 dest: "{{ onos_cord_dest }}/{{ item }}"
27 with_items:
28 - Dockerfile
29 - onos-service
Zack Williams30c01f92017-02-19 23:38:52 -070030 - org.ops4j.pax.logging.cfg
Scott Baker58e88a82016-11-18 13:39:09 -080031
32- name: Copy over ONOS playbook and other files
33 copy:
34 src: "onos-cord-docker-compose.yml"
35 dest: "{{ onos_cord_dest }}/docker-compose.yml"
36
37# TODO: Find the proper place for this on the dev machine rather than
38# copying it within the head node machine.
39
40- name: Copy SSL Certs to ONOS so docker-compose can find it
41 copy:
Zack Williamsc047c872017-01-11 08:38:15 -070042 src: "/usr/local/share/ca-certificates/{{ item }}"
43 dest: "{{ onos_cord_dest }}/{{ item }}"
Scott Baker58e88a82016-11-18 13:39:09 -080044 owner: "{{ ansible_user_id }}"
45 remote_src: True
Zack Williamsc047c872017-01-11 08:38:15 -070046 with_items:
47 - "cord_root_ca.crt"
48 - "cord_intermediate_ca.crt"
Scott Baker58e88a82016-11-18 13:39:09 -080049
50- name: Build onos image
51 command: docker-compose build chdir={{ onos_cord_dest }}
52 tags:
53 - skip_ansible_lint
54
55- name: Start ONOS
56 command: chdir="{{ onos_cord_dest }}" docker-compose up -d
57 tags:
58 - skip_ansible_lint