Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | |
| 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 Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 17 | --- |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 18 | # onos-cord-install/tasks/main.yml |
Scott Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 19 | |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 20 | - name: Pull base docker image for ONOS |
| 21 | docker_image: |
| 22 | name: "{{ onos_docker_image }}" |
Scott Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 23 | |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 24 | - name: Create onos_cord directory |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 25 | 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 Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 32 | |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 33 | - name: Create node_key file with SSH private key for compute nodes |
Scott Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 34 | copy: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 35 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey" |
| 36 | dest: "{{ head_onos_cord_dir }}/node_key" |
Scott Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 37 | owner: "{{ ansible_user_id }}" |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 38 | group: "{{ ansible_user_gid }}" |
Scott Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 39 | mode: 0600 |
| 40 | |
| 41 | - name: Create templated ONOS files |
| 42 | template: |
| 43 | src: "{{ item }}.j2" |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 44 | dest: "{{ head_onos_cord_dir }}/{{ item }}" |
Scott Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 45 | with_items: |
| 46 | - Dockerfile |
Zack Williams | 30c01f9 | 2017-02-19 23:38:52 -0700 | [diff] [blame] | 47 | - org.ops4j.pax.logging.cfg |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 48 | - docker-compose.yml |
Scott Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 49 | |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 50 | - name: Copy SSL Certs to ONOS so docker-compose can find them |
Scott Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 51 | copy: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 52 | src: "{{ pki_dir }}/{{ item.src }}" |
| 53 | dest: "{{ head_onos_cord_dir }}/{{ item.dest }}" |
Scott Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 54 | owner: "{{ ansible_user_id }}" |
Zack Williams | c047c87 | 2017-01-11 08:38:15 -0700 | [diff] [blame] | 55 | with_items: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 56 | - 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 Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 60 | |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 61 | - name: Build xos/onos docker image |
| 62 | docker_image: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 63 | name: "xos/onos:{{ pull_docker_tag }}" |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 64 | path: "{{ head_onos_cord_dir }}" |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 65 | pull: False |
| 66 | force: True |
Scott Baker | 58e88a8 | 2016-11-18 13:39:09 -0800 | [diff] [blame] | 67 | |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 68 | - name: Start ONOS for CORD |
| 69 | docker_service: |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 70 | project_name: "onoscord" |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 71 | project_src: "{{ head_onos_cord_dir }}" |
| 72 | |