blob: 86ec1288b50a6ef1547833d78f96458822c39d64 [file] [log] [blame]
Scott Baker58e88a82016-11-18 13:39:09 -08001---
Zack Williamsc989f262017-05-11 13:02:59 -07002# onos-cord-install/tasks/main.yml
Scott Baker58e88a82016-11-18 13:39:09 -08003
Zack Williamsc989f262017-05-11 13:02:59 -07004- name: Pull base docker image for ONOS
5 docker_image:
6 name: "{{ onos_docker_image }}"
Scott Baker58e88a82016-11-18 13:39:09 -08007
8- name: Create dest directory
Zack Williamsc989f262017-05-11 13:02:59 -07009 become: yes
10 file:
11 path: "{{ head_onos_cord_dir }}"
12 state: directory
13 owner: "{{ ansible_user_id }}"
14 group: "{{ ansible_user_gid }}"
15 mode: 0755
Scott Baker58e88a82016-11-18 13:39:09 -080016
17- name: Copy over SSH key
18 copy:
Zack Williamsc989f262017-05-11 13:02:59 -070019 src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey"
20 dest: "{{ head_onos_cord_dir }}/node_key"
Scott Baker58e88a82016-11-18 13:39:09 -080021 owner: "{{ ansible_user_id }}"
Zack Williamsc989f262017-05-11 13:02:59 -070022 group: "{{ ansible_user_gid }}"
Scott Baker58e88a82016-11-18 13:39:09 -080023 mode: 0600
24
25- name: Create templated ONOS files
26 template:
27 src: "{{ item }}.j2"
Zack Williamsc989f262017-05-11 13:02:59 -070028 dest: "{{ head_onos_cord_dir }}/{{ item }}"
Scott Baker58e88a82016-11-18 13:39:09 -080029 with_items:
30 - Dockerfile
31 - onos-service
Zack Williams30c01f92017-02-19 23:38:52 -070032 - org.ops4j.pax.logging.cfg
Scott Baker58e88a82016-11-18 13:39:09 -080033
34- name: Copy over ONOS playbook and other files
35 copy:
36 src: "onos-cord-docker-compose.yml"
Zack Williamsc989f262017-05-11 13:02:59 -070037 dest: "{{ head_onos_cord_dir }}/docker-compose.yml"
Scott Baker58e88a82016-11-18 13:39:09 -080038
Zack Williamsc989f262017-05-11 13:02:59 -070039- name: Copy SSL Certs to ONOS so docker-compose can find them
Scott Baker58e88a82016-11-18 13:39:09 -080040 copy:
Zack Williamsc989f262017-05-11 13:02:59 -070041 src: "{{ pki_dir }}/{{ item.src }}"
42 dest: "{{ head_onos_cord_dir }}/{{ item.dest }}"
Scott Baker58e88a82016-11-18 13:39:09 -080043 owner: "{{ ansible_user_id }}"
Zack Williamsc047c872017-01-11 08:38:15 -070044 with_items:
Zack Williamsc989f262017-05-11 13:02:59 -070045 - src: "root_ca/certs/ca_cert.pem"
46 dest: "cord_root_ca.crt"
47 - src: "{{ site_name }}_im_ca/certs/im_cert.pem"
48 dest: "cord_{{ site_name }}_im_ca.crt"
Scott Baker58e88a82016-11-18 13:39:09 -080049
Zack Williamsc989f262017-05-11 13:02:59 -070050- name: Build xos/onos docker image
51 docker_image:
52 name: "xos/onos"
53 path: "{{ head_onos_cord_dir }}"
54 dockerfile: "Dockerfile"
Scott Baker58e88a82016-11-18 13:39:09 -080055
Zack Williamsc989f262017-05-11 13:02:59 -070056- name: Start ONOS for CORD
57 docker_service:
58 project_src: "{{ head_onos_cord_dir }}"
59