|
1 | 1 | ---
|
2 |
| -# This playbook is desinged to be used by the overcloud-host-image-build.yml |
| 2 | +# This playbook is designed to be used by the overcloud-host-image-build.yml |
3 | 3 | # GitHub workflow to upload newly-built images to a development cloud for
|
4 | 4 | # testing and use in CI.
|
5 | 5 | - name: Upload an OS image to Glance
|
|
8 | 8 | local_image_path: "/opt/kayobe/images/overcloud-{{ os_distribution }}-{{ os_release }}/overcloud-{{ os_distribution }}-{{ os_release }}.qcow2"
|
9 | 9 | image_name: "overcloud-{{ os_distribution }}-{{ os_release }}"
|
10 | 10 | tasks:
|
11 |
| - - name: Write out clouds.yml |
12 |
| - copy: |
13 |
| - content: "{{ lookup('ansible.builtin.env', 'CLOUDS_YAML') }}" |
14 |
| - dest: clouds.yaml |
15 |
| - mode: 0664 |
| 11 | + - block: |
| 12 | + - name: Write out clouds.yaml |
| 13 | + copy: |
| 14 | + content: "{{ lookup('ansible.builtin.env', 'CLOUDS_YAML') }}" |
| 15 | + dest: clouds.yaml |
| 16 | + mode: 0600 |
16 | 17 |
|
17 |
| - - name: Write out secure.yml |
18 |
| - no_log: true |
19 |
| - vars: |
20 |
| - - os_secrets: |
21 |
| - clouds: |
22 |
| - openstack: |
23 |
| - auth: |
24 |
| - application_credential_id: "{{ lookup('ansible.builtin.env', 'OS_APPLICATION_CREDENTIAL_ID') }}" |
25 |
| - application_credential_secret: "{{ lookup('ansible.builtin.env', 'OS_APPLICATION_CREDENTIAL_SECRET') }}" |
26 |
| - copy: |
27 |
| - content: "{{ os_secrets | to_nice_yaml }}" |
28 |
| - dest: secure.yaml |
29 |
| - mode: 0664 |
| 18 | + - name: Write out secure.yaml |
| 19 | + no_log: true |
| 20 | + vars: |
| 21 | + os_secrets: |
| 22 | + clouds: |
| 23 | + openstack: |
| 24 | + auth: |
| 25 | + application_credential_id: "{{ lookup('ansible.builtin.env', 'OS_APPLICATION_CREDENTIAL_ID') }}" |
| 26 | + application_credential_secret: "{{ lookup('ansible.builtin.env', 'OS_APPLICATION_CREDENTIAL_SECRET') }}" |
| 27 | + copy: |
| 28 | + content: "{{ os_secrets | to_nice_yaml }}" |
| 29 | + dest: secure.yaml |
| 30 | + mode: 0600 |
30 | 31 |
|
31 |
| - - name: Ensure dependencies are installed |
32 |
| - pip: |
33 |
| - name: openstacksdk |
| 32 | + - name: Ensure dependencies are installed |
| 33 | + pip: |
| 34 | + name: openstacksdk |
34 | 35 |
|
35 |
| - - name: Upload an image to Glance |
36 |
| - openstack.cloud.image: |
37 |
| - cloud: openstack |
38 |
| - name: "{{ image_name }}" |
39 |
| - container_format: bare |
40 |
| - disk_format: qcow2 |
41 |
| - state: present |
42 |
| - filename: "{{ local_image_path }}" |
| 36 | + - name: Upload an image to Glance |
| 37 | + openstack.cloud.image: |
| 38 | + cloud: openstack |
| 39 | + name: "{{ image_name }}" |
| 40 | + container_format: bare |
| 41 | + disk_format: qcow2 |
| 42 | + state: present |
| 43 | + filename: "{{ local_image_path }}" |
| 44 | + |
| 45 | + always: |
| 46 | + - name: Remove clouds.yaml |
| 47 | + file: |
| 48 | + path: clouds.yaml |
| 49 | + state: absent |
| 50 | + |
| 51 | + - name: Remove secure.yaml |
| 52 | + file: |
| 53 | + path: secure.yaml |
| 54 | + state: absent |
0 commit comments