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 | |
Zack Williams | 2478b30 | 2017-02-14 10:42:55 -0700 | [diff] [blame] | 14 | - name: Create cord_profile/profile_name with the name of the profile |
| 15 | copy: |
| 16 | dest: "{{ cord_profile_dir }}/profile_name" |
| 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: |
| 22 | path: "{{ cord_profile_dir }}/{{ item }}" |
| 23 | state: directory |
| 24 | mode: 0755 |
| 25 | with_items: |
| 26 | - key_import |
| 27 | - onboarding-docker-compose |
| 28 | - images |
| 29 | |
| 30 | - name: Copy ssh keys to key_import directory |
| 31 | copy: |
| 32 | remote_src: True # file is local to the remote machine |
| 33 | src: "{{ item.source_path | expanduser }}" |
| 34 | dest: "{{ cord_profile_dir }}/key_import/{{ item.name }}" |
| 35 | mode: 0600 |
| 36 | with_items: "{{ xos_service_sshkeys }}" |
| 37 | |
Andy Bavier | f0b5d7d | 2017-03-15 16:19:03 -0400 | [diff] [blame^] | 38 | - name: Copy over core api key and cert |
| 39 | copy: |
| 40 | src: "{{ pki_dir }}/{{ item }}" |
| 41 | dest: "{{ cord_profile_dir }}/{{ item }}" |
| 42 | mode: 0600 |
| 43 | with_items: |
| 44 | - core_api_key.pem |
| 45 | - core_api_cert.pem |
| 46 | |
Zack Williams | c6ff6b3 | 2017-02-10 16:35:29 -0700 | [diff] [blame] | 47 | - name: Make Image directory ( outside of profile directory to avoid repeat downloads on sequential runs) |
| 48 | become: yes |
| 49 | file: |
| 50 | path: "{{ cord_dir }}/images" |
| 51 | state: directory |
| 52 | mode: 0755 |
| 53 | owner: "{{ ansible_user_id }}" |
| 54 | group: "{{ ansible_user_gid }}" |
| 55 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 56 | - name: Download Glance VM images |
| 57 | get_url: |
| 58 | url: "{{ item.url }}" |
| 59 | checksum: "{{ item.checksum }}" |
Zack Williams | c6ff6b3 | 2017-02-10 16:35:29 -0700 | [diff] [blame] | 60 | dest: "{{ cord_dir }}/images/{{ item.name }}.qcow2" |
| 61 | with_items: "{{ xos_images }}" |
| 62 | |
| 63 | - name: Copy Glance VM images to profile directory |
| 64 | copy: |
| 65 | remote_src: True |
| 66 | src: "{{ cord_dir }}/images/{{ item.name }}.qcow2" |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 67 | dest: "{{ cord_profile_dir }}/images/{{ item.name }}.qcow2" |
| 68 | with_items: "{{ xos_images }}" |
| 69 | |
| 70 | - name: Copy over commonly used and utility TOSCA files |
| 71 | copy: |
| 72 | src: "{{ item }}" |
| 73 | dest: "{{ cord_profile_dir }}/{{ item }}" |
| 74 | with_items: |
| 75 | - fixtures.yaml |
| 76 | - enable-onboarding.yaml |
| 77 | - disable-onboarding.yaml |
| 78 | |
| 79 | - name: Create templated XOS configuration files |
| 80 | template: |
| 81 | src: "{{ item }}.j2" |
| 82 | dest: "{{ cord_profile_dir }}/{{ item }}" |
| 83 | mode: 0644 |
| 84 | with_items: |
| 85 | - xos_common_config |
| 86 | - deployment.yaml |
| 87 | - xos.yaml |
| 88 | - xos-bootstrap-docker-compose.yaml |
Scott Baker | 5ca4bd1 | 2017-02-10 15:17:06 -0800 | [diff] [blame] | 89 | - onboard-chameleon.yaml |
Matteo Scandolo | 6050fda | 2017-02-16 13:01:52 -0800 | [diff] [blame] | 90 | - onboard-gui-extensions-store.yaml |
Scott Baker | 970f24b | 2017-02-13 14:16:40 -0800 | [diff] [blame] | 91 | - onboard-xos-gui.yaml |
| 92 | - onboard-xos-rest-gw.yaml |
| 93 | - gateway-config.yml |
Matteo Scandolo | 667334f | 2017-02-26 10:58:08 -0800 | [diff] [blame] | 94 | - style.config.js |
| 95 | - app.config.js |
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" |
| 100 | dest: "{{ cord_profile_dir }}/{{ item }}" |
| 101 | with_items: "{{ xos_tosca_config_templates }}" |
| 102 | |
| 103 | - name: Create profile specific templated non-TOSCA files |
| 104 | template: |
| 105 | src: "{{ item }}.j2" |
| 106 | dest: "{{ cord_profile_dir }}/{{ item }}" |
| 107 | with_items: "{{ xos_other_templates }}" |
| 108 | |
| 109 | - name: Copy admin_openrc.sh |
| 110 | when: use_openstack |
| 111 | copy: |
| 112 | remote_src: True |
| 113 | src: "{{ ansible_user_dir }}/admin-openrc.sh" |
| 114 | dest: "{{ cord_profile_dir }}/admin-openrc.sh" |
| 115 | |
Zack Williams | 2a5f686 | 2017-02-09 16:39:52 -0700 | [diff] [blame] | 116 | - name: Copy node_key to cord_profile directory |
| 117 | when: use_openstack |
| 118 | copy: |
| 119 | remote_src: True # file is local to the remote machine |
| 120 | src: "{{ ansible_user_dir }}/node_key" |
| 121 | dest: "{{ cord_profile_dir }}/node_key" |
| 122 | mode: 0600 |