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