|
1 | 1 | ---
|
2 |
| -# Tag is the version of the image to promote, stored in an env variable named OVERCLOUD_HOST_IMAGE_TAG |
3 |
| -- name: Promote an image to production |
| 2 | +# Tag is the version of the artifact to promote, stored in an env variable named ARTIFACT_TAG |
| 3 | +- name: Promote an artifact to production |
4 | 4 | hosts: localhost
|
5 | 5 | vars:
|
6 | 6 | remote_pulp_url: "{{ stackhpc_release_pulp_url }}"
|
7 | 7 | remote_pulp_username: "{{ stackhpc_release_pulp_username }}"
|
8 | 8 | remote_pulp_password: "{{ stackhpc_release_pulp_password }}"
|
9 |
| - repository_name: "kayobe-images-{{ openstack_release }}-{{ os_distribution }}-{{ os_release }}" |
10 |
| - base_path: "kayobe-images/{{ openstack_release }}/{{ os_distribution }}/{{ os_release }}" |
11 |
| - promotion_tag: "{{ lookup('env', 'OVERCLOUD_HOST_IMAGE_TAG') }}" |
| 9 | + repository_name: "{{ artifact_type }}-{{ openstack_release }}-{{ os_distribution }}-{{ os_release }}" |
| 10 | + pulp_base_path: "{{ artifact_type }}/{{ openstack_release }}/{{ os_distribution }}/{{ os_release }}" |
| 11 | + promotion_tag: "{{ lookup('env', 'ARTIFACT_TAG') }}" |
12 | 12 | tasks:
|
13 |
| - |
14 |
| - - name: Check whether the image exists |
| 13 | + - name: Check whether the artifact exists |
15 | 14 | pulp.squeezer.file_distribution:
|
16 | 15 | pulp_url: "{{ remote_pulp_url }}"
|
17 | 16 | username: "{{ remote_pulp_username }}"
|
18 | 17 | password: "{{ remote_pulp_password }}"
|
19 | 18 | name: "{{ repository_name }}_{{ promotion_tag }}"
|
20 |
| - base_path: "{{ base_path }}/{{ promotion_tag }}" |
| 19 | + base_path: "{{ pulp_base_path }}/{{ promotion_tag }}" |
21 | 20 | register: distribution_details
|
22 | 21 | until: distribution_details is success
|
23 | 22 | retries: 3
|
24 | 23 | delay: 5
|
25 | 24 |
|
26 |
| - - name: Fail if the image does not exist |
| 25 | + - name: Fail if the artifact does not exist |
27 | 26 | fail:
|
28 |
| - msg: "Image {{ promotion_tag }} does not exist" |
| 27 | + msg: "artifact {{ promotion_tag }} does not exist" |
29 | 28 | when: distribution_details.distribution is none
|
30 | 29 |
|
31 | 30 | - name: Ensure production content guard is set
|
|
34 | 33 | username: "{{ remote_pulp_username }}"
|
35 | 34 | password: "{{ remote_pulp_password }}"
|
36 | 35 | name: "{{ repository_name }}_{{ promotion_tag }}"
|
37 |
| - base_path: "{{ base_path }}/{{ promotion_tag }}" |
| 36 | + base_path: "{{ pulp_base_path }}/{{ promotion_tag }}" |
38 | 37 | content_guard: release
|
39 | 38 | state: present
|
40 | 39 | register: content_guard_result
|
|
0 commit comments