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 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 17 | --- |
| 18 | # cord-profile/tasks/main.yml |
| 19 | # Constructs a CORD service profile directory and configuration files |
| 20 | |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 21 | # if this step fails, may need to include `create-configdirs-become` role to |
| 22 | # create directory using become. |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 23 | - name: Create cord_profile directory |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 24 | file: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 25 | path: "{{ config_cord_profile_dir }}" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 26 | state: directory |
| 27 | mode: 0755 |
| 28 | owner: "{{ ansible_user_id }}" |
| 29 | group: "{{ ansible_user_gid }}" |
| 30 | |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 31 | - name: Create cord_profile/profile_name file containing profile name |
Zack Williams | 2478b30 | 2017-02-14 10:42:55 -0700 | [diff] [blame] | 32 | copy: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 33 | dest: "{{ config_cord_profile_dir }}/profile_name" |
Zack Williams | 2478b30 | 2017-02-14 10:42:55 -0700 | [diff] [blame] | 34 | content: "{{ cord_profile }}" |
| 35 | mode: 0644 |
| 36 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 37 | - name: Create subdirectories inside cord_profile directory |
| 38 | file: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 39 | path: "{{ config_cord_profile_dir }}/{{ item }}" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 40 | state: directory |
| 41 | mode: 0755 |
| 42 | with_items: |
| 43 | - key_import |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 44 | - images |
| 45 | |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 46 | - name: Copy ssh private key to node_key file |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 47 | copy: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 48 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey" |
| 49 | dest: "{{ config_cord_profile_dir }}/node_key" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 50 | mode: 0600 |
Andy Bavier | 1ff4b48 | 2017-03-24 09:20:36 -0400 | [diff] [blame] | 51 | remote_src: True |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 52 | |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 53 | - name: Copy ssh public key to node_key.pub file |
| 54 | copy: |
| 55 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub" |
| 56 | dest: "{{ config_cord_profile_dir }}/node_key.pub" |
| 57 | mode: 0600 |
| 58 | remote_src: True |
| 59 | |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 60 | - name: Copy ssh private key to key_import directory for services that require it |
| 61 | copy: |
| 62 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey" |
| 63 | dest: "{{ config_cord_profile_dir }}/key_import/{{ item.keypair }}" |
| 64 | mode: 0600 |
| 65 | remote_src: True |
| 66 | with_items: "{{ xos_services | selectattr('keypair', 'defined') | list }}" |
| 67 | |
| 68 | - name: Copy ssh public key to key_import directory for services that require it |
| 69 | copy: |
| 70 | src: "{{ ssh_pki_dir }}/client_certs/{{ pod_sshkey_name }}_sshkey.pub" |
| 71 | dest: "{{ config_cord_profile_dir }}/key_import/{{ item.keypair }}.pub" |
| 72 | mode: 0644 |
| 73 | remote_src: True |
| 74 | with_items: "{{ xos_services | selectattr('keypair', 'defined') | list }}" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 75 | |
Andy Bavier | a6cffe1 | 2017-03-15 17:33:42 -0400 | [diff] [blame] | 76 | - name: Copy cert chain and core api key and cert |
Andy Bavier | f0b5d7d | 2017-03-15 16:19:03 -0400 | [diff] [blame] | 77 | copy: |
Zack Williams | 44845c6 | 2017-04-21 13:57:14 -0700 | [diff] [blame] | 78 | src: "{{ pki_dir }}/{{ item.src }}" |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 79 | dest: "{{ config_cord_profile_dir }}/{{ item.dest }}" |
Andy Bavier | f0b5d7d | 2017-03-15 16:19:03 -0400 | [diff] [blame] | 80 | mode: 0600 |
| 81 | with_items: |
Zack Williams | 44845c6 | 2017-04-21 13:57:14 -0700 | [diff] [blame] | 82 | - src: "{{ site_name }}_im_ca/private/xos-core.{{ site_suffix }}_key.pem" |
| 83 | dest: "core_api_key.pem" |
| 84 | - src: "{{ site_name }}_im_ca/certs/xos-core.{{ site_suffix }}_cert_chain.pem" |
| 85 | dest: "core_api_cert.pem" |
| 86 | - src: "{{ site_name }}_im_ca/certs/im_cert_chain.pem" |
| 87 | dest: "im_cert_chain.pem" |
Andy Bavier | f0b5d7d | 2017-03-15 16:19:03 -0400 | [diff] [blame] | 88 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 89 | - name: Copy over commonly used and utility TOSCA files |
| 90 | copy: |
| 91 | src: "{{ item }}" |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 92 | dest: "{{ config_cord_profile_dir }}/{{ item }}" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 93 | with_items: |
| 94 | - fixtures.yaml |
| 95 | - enable-onboarding.yaml |
| 96 | - disable-onboarding.yaml |
| 97 | |
| 98 | - name: Create templated XOS configuration files |
| 99 | template: |
| 100 | src: "{{ item }}.j2" |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 101 | dest: "{{ config_cord_profile_dir }}/{{ item }}" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 102 | mode: 0644 |
| 103 | with_items: |
Matteo Scandolo | d222134 | 2017-05-25 18:16:57 -0700 | [diff] [blame] | 104 | - xos_config.yaml |
Zack Williams | 9cea13e | 2017-07-25 16:32:59 -0700 | [diff] [blame] | 105 | - xos_config_synchronizer.yaml |
Matteo Scandolo | b92469d | 2017-07-28 17:32:00 -0700 | [diff] [blame] | 106 | - initial_data.yaml |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 107 | - deployment.yaml |
| 108 | - xos.yaml |
Scott Baker | 970f24b | 2017-02-13 14:16:40 -0800 | [diff] [blame] | 109 | - gateway-config.yml |
Matteo Scandolo | 667334f | 2017-02-26 10:58:08 -0800 | [diff] [blame] | 110 | - style.config.js |
| 111 | - app.config.js |
Andy Bavier | a6cffe1 | 2017-03-15 17:33:42 -0400 | [diff] [blame] | 112 | - Dockerfile.xos |
Andy Bavier | a6cffe1 | 2017-03-15 17:33:42 -0400 | [diff] [blame] | 113 | - xos-gui-extensions.yml |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 114 | - docker-compose.yml |
Matteo Scandolo | c4f2c5f | 2017-07-12 16:25:08 -0700 | [diff] [blame] | 115 | - xos-tosca.config.yaml |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 116 | |
| 117 | - name: Create profile specific templated TOSCA config files |
| 118 | template: |
| 119 | src: "{{ item }}.j2" |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 120 | dest: "{{ config_cord_profile_dir }}/{{ item }}" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 121 | with_items: "{{ xos_tosca_config_templates }}" |
| 122 | |
Matteo Scandolo | b76c257 | 2017-10-02 18:05:58 -0700 | [diff] [blame] | 123 | - name: Create profile specific templated TOSCA config files (new Engine) |
| 124 | template: |
| 125 | src: "{{ item }}.j2" |
| 126 | dest: "{{ config_cord_profile_dir }}/{{ item }}" |
| 127 | with_items: "{{ xos_new_tosca_config_templates }}" |
| 128 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 129 | - name: Create profile specific templated non-TOSCA files |
| 130 | template: |
| 131 | src: "{{ item }}.j2" |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 132 | dest: "{{ config_cord_profile_dir }}/{{ item }}" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 133 | with_items: "{{ xos_other_templates }}" |
| 134 | |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 135 | - name: Create OpenStack config and TOSCA onboarding |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 136 | template: |
| 137 | src: "{{ item }}.j2" |
| 138 | dest: "{{ config_cord_profile_dir }}/{{ item }}" |
Andy Bavier | a6cffe1 | 2017-03-15 17:33:42 -0400 | [diff] [blame] | 139 | with_items: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 140 | - openstack.yaml |
| 141 | - admin-openrc.sh |
Andy Bavier | a6cffe1 | 2017-03-15 17:33:42 -0400 | [diff] [blame] | 142 | |