|
7 | 7 | remote_pulp_password: "{{ stackhpc_release_pulp_password }}"
|
8 | 8 | repository_name: "{{ artifact_type }}-{{ openstack_release }}-{{ os_distribution }}-{{ os_release }}"
|
9 | 9 | pulp_base_path: "{{ artifact_type }}/{{ openstack_release }}/{{ os_distribution }}/{{ os_release }}"
|
| 10 | + upload_checksum: false |
10 | 11 | tasks:
|
11 | 12 | - name: Print artifact tag
|
12 | 13 | debug:
|
|
36 | 37 | checksum_algorithm: sha256
|
37 | 38 | register: file_stats
|
38 | 39 |
|
| 40 | + - name: Write checksum to file |
| 41 | + ansible.builtin.copy: |
| 42 | + content: "{{ file_stats.stat.checksum }}" |
| 43 | + dest: "/tmp/{{ found_files.files[0].path | basename }}.sha256" |
| 44 | + when: upload_checksum |
| 45 | + |
| 46 | + - name: Upload checksum artifact |
| 47 | + pulp.squeezer.artifact: |
| 48 | + pulp_url: "{{ remote_pulp_url }}" |
| 49 | + username: "{{ remote_pulp_username }}" |
| 50 | + password: "{{ remote_pulp_password }}" |
| 51 | + file: "/tmp/{{ found_files.files[0].path | basename }}.sha256" |
| 52 | + state: present |
| 53 | + register: checksum_upload_result |
| 54 | + until: checksum_upload_result is success |
| 55 | + retries: 3 |
| 56 | + delay: 60 |
| 57 | + when: upload_checksum |
| 58 | + |
39 | 59 | - name: Create file content from artifact
|
40 | 60 | pulp.squeezer.file_content:
|
41 | 61 | pulp_url: "{{ remote_pulp_url }}"
|
|
49 | 69 | retries: 3
|
50 | 70 | delay: 5
|
51 | 71 |
|
| 72 | + - name: Create checksum content from artifact |
| 73 | + pulp.squeezer.file_content: |
| 74 | + pulp_url: "{{ remote_pulp_url }}" |
| 75 | + username: "{{ remote_pulp_username }}" |
| 76 | + password: "{{ remote_pulp_password }}" |
| 77 | + relative_path: "{{ found_files.files[0].path | basename }}.sha256" |
| 78 | + state: present |
| 79 | + register: checksum_content_result |
| 80 | + until: checksum_content_result is success |
| 81 | + retries: 3 |
| 82 | + delay: 5 |
| 83 | + when: upload_checksum |
| 84 | + |
52 | 85 | - name: Ensure file repo exists
|
53 | 86 | pulp.squeezer.file_repository:
|
54 | 87 | pulp_url: "{{ remote_pulp_url }}"
|
|
75 | 108 | retries: 3
|
76 | 109 | delay: 5
|
77 | 110 |
|
| 111 | + - name: Add checksum content to file repo |
| 112 | + pulp.squeezer.file_repository_content: |
| 113 | + pulp_url: "{{ remote_pulp_url }}" |
| 114 | + username: "{{ remote_pulp_username }}" |
| 115 | + password: "{{ remote_pulp_password }}" |
| 116 | + repository: "{{ repository_name }}" |
| 117 | + present_content: |
| 118 | + - relative_path: "{{ found_files.files[0].path | basename }}.sha256" |
| 119 | + register: checksum_repo_content_result |
| 120 | + until: checksum_repo_content_result is success |
| 121 | + retries: 3 |
| 122 | + delay: 5 |
| 123 | + when: upload_checksum |
| 124 | + |
78 | 125 | - name: Create a new publication to point to this version
|
79 | 126 | pulp.squeezer.file_publication:
|
80 | 127 | pulp_url: "{{ remote_pulp_url }}"
|
|
0 commit comments