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