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