blob: b0f9094bc20c2ca88adb39f62921f75650f22d3d [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Scott Baker58e88a82016-11-18 13:39:09 -080017---
Zack Williamsc989f262017-05-11 13:02:59 -070018# onos-cord-install/tasks/main.yml
Scott Baker58e88a82016-11-18 13:39:09 -080019
Zack Williamsc989f262017-05-11 13:02:59 -070020- name: Pull base docker image for ONOS
21 docker_image:
22 name: "{{ onos_docker_image }}"
Scott Baker58e88a82016-11-18 13:39:09 -080023
Zack Williams79286962017-07-10 12:24:37 -070024- name: Create onos_cord directory
Zack Williamsc989f262017-05-11 13:02:59 -070025 become: yes
26 file:
27 path: "{{ head_onos_cord_dir }}"
28 state: directory
29 owner: "{{ ansible_user_id }}"
30 group: "{{ ansible_user_gid }}"
31 mode: 0755
Scott Baker58e88a82016-11-18 13:39:09 -080032
Zack Williams79286962017-07-10 12:24:37 -070033- name: Create node_key file with SSH private key for compute nodes
Scott Baker58e88a82016-11-18 13:39:09 -080034 copy:
Zack Williamsc989f262017-05-11 13:02:59 -070035 src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey"
36 dest: "{{ head_onos_cord_dir }}/node_key"
Scott Baker58e88a82016-11-18 13:39:09 -080037 owner: "{{ ansible_user_id }}"
Zack Williamsc989f262017-05-11 13:02:59 -070038 group: "{{ ansible_user_gid }}"
Scott Baker58e88a82016-11-18 13:39:09 -080039 mode: 0600
40
41- name: Create templated ONOS files
42 template:
43 src: "{{ item }}.j2"
Zack Williamsc989f262017-05-11 13:02:59 -070044 dest: "{{ head_onos_cord_dir }}/{{ item }}"
Scott Baker58e88a82016-11-18 13:39:09 -080045 with_items:
46 - Dockerfile
Zack Williams30c01f92017-02-19 23:38:52 -070047 - org.ops4j.pax.logging.cfg
Zack Williams79286962017-07-10 12:24:37 -070048 - docker-compose.yml
Scott Baker58e88a82016-11-18 13:39:09 -080049
Zack Williamsc989f262017-05-11 13:02:59 -070050- name: Copy SSL Certs to ONOS so docker-compose can find them
Scott Baker58e88a82016-11-18 13:39:09 -080051 copy:
Zack Williamsc989f262017-05-11 13:02:59 -070052 src: "{{ pki_dir }}/{{ item.src }}"
53 dest: "{{ head_onos_cord_dir }}/{{ item.dest }}"
Scott Baker58e88a82016-11-18 13:39:09 -080054 owner: "{{ ansible_user_id }}"
Zack Williamsc047c872017-01-11 08:38:15 -070055 with_items:
Zack Williamsc989f262017-05-11 13:02:59 -070056 - src: "root_ca/certs/ca_cert.pem"
57 dest: "cord_root_ca.crt"
58 - src: "{{ site_name }}_im_ca/certs/im_cert.pem"
59 dest: "cord_{{ site_name }}_im_ca.crt"
Scott Baker58e88a82016-11-18 13:39:09 -080060
Zack Williamsc989f262017-05-11 13:02:59 -070061- name: Build xos/onos docker image
62 docker_image:
Andy Bavier75e17122017-07-26 09:07:19 -070063 name: "xos/onos:{{ pull_docker_tag }}"
Zack Williamsc989f262017-05-11 13:02:59 -070064 path: "{{ head_onos_cord_dir }}"
Zack Williams79286962017-07-10 12:24:37 -070065 pull: False
66 force: True
Scott Baker58e88a82016-11-18 13:39:09 -080067
Zack Williamsc989f262017-05-11 13:02:59 -070068- name: Start ONOS for CORD
69 docker_service:
Zack Williams79286962017-07-10 12:24:37 -070070 project_name: "onoscord"
Zack Williamsc989f262017-05-11 13:02:59 -070071 project_src: "{{ head_onos_cord_dir }}"
72