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