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: |
| 8 | path: "{{ cord_profile_dir }}" |
| 9 | state: directory |
| 10 | mode: 0755 |
| 11 | owner: "{{ ansible_user_id }}" |
| 12 | group: "{{ ansible_user_gid }}" |
| 13 | |
| 14 | - name: Create subdirectories inside cord_profile directory |
| 15 | file: |
| 16 | path: "{{ cord_profile_dir }}/{{ item }}" |
| 17 | state: directory |
| 18 | mode: 0755 |
| 19 | with_items: |
| 20 | - key_import |
| 21 | - onboarding-docker-compose |
| 22 | - images |
| 23 | |
| 24 | - name: Copy ssh keys to key_import directory |
| 25 | copy: |
| 26 | remote_src: True # file is local to the remote machine |
| 27 | src: "{{ item.source_path | expanduser }}" |
| 28 | dest: "{{ cord_profile_dir }}/key_import/{{ item.name }}" |
| 29 | mode: 0600 |
| 30 | with_items: "{{ xos_service_sshkeys }}" |
| 31 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 32 | - name: Copy over core api key |
| 33 | copy: |
| 34 | src: "{{ playbook_dir }}/pki/intermediate_ca/private/xos-core.{{ site_suffix }}_key.pem" |
| 35 | dest: "{{ cord_profile_dir }}/core_api_key.pem" |
| 36 | mode: 0600 |
| 37 | |
| 38 | - name: Copy over core api cert |
| 39 | copy: |
| 40 | src: "{{ playbook_dir }}/pki/intermediate_ca/certs/xos-core.{{ site_suffix }}_cert_chain.pem" |
| 41 | dest: "{{ cord_profile_dir }}/core_api_cert.pem" |
| 42 | |
| 43 | - name: Download Glance VM images |
| 44 | get_url: |
| 45 | url: "{{ item.url }}" |
| 46 | checksum: "{{ item.checksum }}" |
| 47 | dest: "{{ cord_profile_dir }}/images/{{ item.name }}.qcow2" |
| 48 | with_items: "{{ xos_images }}" |
| 49 | |
| 50 | - name: Copy over commonly used and utility TOSCA files |
| 51 | copy: |
| 52 | src: "{{ item }}" |
| 53 | dest: "{{ cord_profile_dir }}/{{ item }}" |
| 54 | with_items: |
| 55 | - fixtures.yaml |
| 56 | - enable-onboarding.yaml |
| 57 | - disable-onboarding.yaml |
| 58 | |
| 59 | - name: Create templated XOS configuration files |
| 60 | template: |
| 61 | src: "{{ item }}.j2" |
| 62 | dest: "{{ cord_profile_dir }}/{{ item }}" |
| 63 | mode: 0644 |
| 64 | with_items: |
| 65 | - xos_common_config |
| 66 | - deployment.yaml |
| 67 | - xos.yaml |
| 68 | - xos-bootstrap-docker-compose.yaml |
| 69 | |
| 70 | - name: Create profile specific templated TOSCA config files |
| 71 | template: |
| 72 | src: "{{ item }}.j2" |
| 73 | dest: "{{ cord_profile_dir }}/{{ item }}" |
| 74 | with_items: "{{ xos_tosca_config_templates }}" |
| 75 | |
| 76 | - name: Create profile specific templated non-TOSCA files |
| 77 | template: |
| 78 | src: "{{ item }}.j2" |
| 79 | dest: "{{ cord_profile_dir }}/{{ item }}" |
| 80 | with_items: "{{ xos_other_templates }}" |
| 81 | |
| 82 | - name: Copy admin_openrc.sh |
| 83 | when: use_openstack |
| 84 | copy: |
| 85 | remote_src: True |
| 86 | src: "{{ ansible_user_dir }}/admin-openrc.sh" |
| 87 | dest: "{{ cord_profile_dir }}/admin-openrc.sh" |
| 88 | |
Zack Williams | 2a5f686 | 2017-02-09 16:39:52 -0700 | [diff] [blame] | 89 | - name: Copy node_key to cord_profile directory |
| 90 | when: use_openstack |
| 91 | copy: |
| 92 | remote_src: True # file is local to the remote machine |
| 93 | src: "{{ ansible_user_dir }}/node_key" |
| 94 | dest: "{{ cord_profile_dir }}/node_key" |
| 95 | mode: 0600 |
| 96 | |