blob: 000a73a14ac2a6abf0ccd438ecb7e0694092b6c4 [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
Zack Williams79286962017-07-10 12:24:37 -07008- name: Create onos_cord 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
Zack Williams79286962017-07-10 12:24:37 -070017- name: Create node_key file with SSH private key for compute nodes
Scott Baker58e88a82016-11-18 13:39:09 -080018 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
Zack Williams79286962017-07-10 12:24:37 -070033 - docker-compose.yml
Scott Baker58e88a82016-11-18 13:39:09 -080034
Zack Williamsc989f262017-05-11 13:02:59 -070035- name: Copy SSL Certs to ONOS so docker-compose can find them
Scott Baker58e88a82016-11-18 13:39:09 -080036 copy:
Zack Williamsc989f262017-05-11 13:02:59 -070037 src: "{{ pki_dir }}/{{ item.src }}"
38 dest: "{{ head_onos_cord_dir }}/{{ item.dest }}"
Scott Baker58e88a82016-11-18 13:39:09 -080039 owner: "{{ ansible_user_id }}"
Zack Williamsc047c872017-01-11 08:38:15 -070040 with_items:
Zack Williamsc989f262017-05-11 13:02:59 -070041 - src: "root_ca/certs/ca_cert.pem"
42 dest: "cord_root_ca.crt"
43 - src: "{{ site_name }}_im_ca/certs/im_cert.pem"
44 dest: "cord_{{ site_name }}_im_ca.crt"
Scott Baker58e88a82016-11-18 13:39:09 -080045
Zack Williamsc989f262017-05-11 13:02:59 -070046- name: Build xos/onos docker image
47 docker_image:
Zack Williams79286962017-07-10 12:24:37 -070048 name: "xos/onos:{{ deploy_docker_tag }}"
Zack Williamsc989f262017-05-11 13:02:59 -070049 path: "{{ head_onos_cord_dir }}"
Zack Williams79286962017-07-10 12:24:37 -070050 pull: False
51 force: True
Scott Baker58e88a82016-11-18 13:39:09 -080052
Zack Williamsc989f262017-05-11 13:02:59 -070053- name: Start ONOS for CORD
54 docker_service:
Zack Williams79286962017-07-10 12:24:37 -070055 project_name: "onoscord"
Zack Williamsc989f262017-05-11 13:02:59 -070056 project_src: "{{ head_onos_cord_dir }}"
57