|
1 | 1 | --- |
2 | | -- name: Upload and create a distribution for an image |
| 2 | +- name: Upload and create a distribution for an artifact |
3 | 3 | hosts: seed |
4 | 4 | vars: |
5 | 5 | remote_pulp_url: "{{ stackhpc_release_pulp_url }}" |
6 | 6 | remote_pulp_username: "{{ stackhpc_image_repository_username }}" |
7 | 7 | remote_pulp_password: "{{ stackhpc_image_repository_password }}" |
8 | | - repository_name: "{{ image_name }}-{{ openstack_release }}-{{ os_distribution }}-{{ os_release }}" |
9 | | - pulp_base_path: "{{ image_name }}/{{ openstack_release }}/{{ os_distribution }}/{{ os_release }}" |
| 8 | + repository_name: "{{ artifact_path }}-{{ openstack_release }}-{{ os_distribution }}-{{ os_release }}" |
| 9 | + pulp_base_path: "{{ artifact_path }}/{{ openstack_release }}/{{ os_distribution }}/{{ os_release }}" |
10 | 10 | file_extension: 'qcow2' |
11 | 11 | tasks: |
12 | | - - name: Print image tag |
| 12 | + - name: Print artifact tag |
13 | 13 | debug: |
14 | | - msg: "Image tag: {{ image_tag }}" |
| 14 | + msg: "artifact tag: {{ artifact_tag }}" |
15 | 15 |
|
16 | 16 | - name: Get filename |
17 | 17 | find: |
18 | | - paths: "{{ image_path }}" |
| 18 | + paths: "{{ artifact_path }}" |
19 | 19 | patterns: "*.{{ file_extension }}" |
20 | 20 | register: found_files |
21 | 21 |
|
|
108 | 108 | pulp_url: "{{ remote_pulp_url }}" |
109 | 109 | username: "{{ remote_pulp_username }}" |
110 | 110 | password: "{{ remote_pulp_password }}" |
111 | | - name: "{{ repository_name }}_{{ image_tag }}" |
112 | | - base_path: "{{ pulp_base_path }}/{{ image_tag }}" |
| 111 | + name: "{{ repository_name }}_{{ artifact_tag }}" |
| 112 | + base_path: "{{ pulp_base_path }}/{{ artifact_tag }}" |
113 | 113 | publication: "{{ publication_details.publication.pulp_href }}" |
114 | 114 | content_guard: development |
115 | 115 | state: present |
|
119 | 119 | retries: 3 |
120 | 120 | delay: 5 |
121 | 121 |
|
122 | | - - name: Update new images file with versioned path |
| 122 | + - name: Update new artifacts file with versioned path |
123 | 123 | lineinfile: |
124 | | - path: /tmp/updated_images.txt |
| 124 | + path: /tmp/updated_artifacts.txt |
125 | 125 | line: "{{ remote_pulp_url }}/pulp/content/{{ pulp_base_path }}/\ |
126 | | - {{ image_tag }}/{{ found_files.files[0].path | basename }}" |
| 126 | + {{ artifact_tag }}/{{ found_files.files[0].path | basename }}" |
127 | 127 | create: true |
128 | 128 |
|
129 | | - - name: Update new images file with latest path |
| 129 | + - name: Update new artifacts file with latest path |
130 | 130 | lineinfile: |
131 | | - path: /tmp/updated_images.txt |
| 131 | + path: /tmp/updated_artifacts.txt |
132 | 132 | line: "{{ remote_pulp_url }}/pulp/content/{{ pulp_base_path }}/\ |
133 | 133 | latest/{{ found_files.files[0].path | basename }}" |
134 | 134 | when: latest_distribution_details.changed |
135 | 135 |
|
136 | 136 | - name: Print versioned path |
137 | 137 | debug: |
138 | 138 | msg: "New versioned path: {{ remote_pulp_url }}/pulp/content/{{ pulp_base_path }}/\ |
139 | | - {{ image_tag }}/{{ found_files.files[0].path | basename }}" |
| 139 | + {{ artifact_tag }}/{{ found_files.files[0].path | basename }}" |
140 | 140 | when: latest_distribution_details.changed |
141 | 141 |
|
142 | 142 | - name: Print latest path |
|
147 | 147 |
|
148 | 148 | - name: Print version tag |
149 | 149 | debug: |
150 | | - msg: "New tag: {{ image_tag }}" |
| 150 | + msg: "New tag: {{ artifact_tag }}" |
151 | 151 | when: latest_distribution_details.changed |
0 commit comments