|
28 | 28 | - urllib3 |
29 | 29 | state: present |
30 | 30 |
|
31 | | - - name: Upload an artifact |
32 | | - pulp.squeezer.artifact: |
33 | | - pulp_url: "{{ remote_pulp_url }}" |
34 | | - username: "{{ remote_pulp_username }}" |
35 | | - password: "{{ remote_pulp_password }}" |
36 | | - file: "{{ found_files.files[0].path }}" |
37 | | - state: present |
38 | | - register: upload_result |
39 | | - until: upload_result is success |
40 | | - retries: 3 |
41 | | - delay: 60 |
42 | | - |
43 | 31 | - name: Get sha256 hash |
44 | 32 | ansible.builtin.stat: |
45 | 33 | path: "{{ found_files.files[0].path }}" |
|
58 | 46 | checksum_algorithm: sha256 |
59 | 47 | register: checksum_stats |
60 | 48 |
|
61 | | - - name: Upload checksum artifact |
62 | | - pulp.squeezer.artifact: |
| 49 | + - name: Ensure file repo exists |
| 50 | + pulp.squeezer.file_repository: |
63 | 51 | pulp_url: "{{ remote_pulp_url }}" |
64 | 52 | username: "{{ remote_pulp_username }}" |
65 | 53 | password: "{{ remote_pulp_password }}" |
66 | | - file: "/tmp/{{ found_files.files[0].path | basename }}.sha256" |
| 54 | + name: "{{ repository_name }}" |
67 | 55 | state: present |
68 | | - register: checksum_upload_result |
69 | | - until: checksum_upload_result is success |
| 56 | + register: file_repo_result |
| 57 | + until: file_repo_result is success |
70 | 58 | retries: 3 |
71 | | - delay: 60 |
72 | | - when: upload_checksum |
| 59 | + delay: 5 |
73 | 60 |
|
74 | | - - name: Create file content from artifact |
| 61 | + - name: Upload artifact |
75 | 62 | pulp.squeezer.file_content: |
76 | 63 | pulp_url: "{{ remote_pulp_url }}" |
77 | 64 | username: "{{ remote_pulp_username }}" |
78 | 65 | password: "{{ remote_pulp_password }}" |
| 66 | + file: "{{ found_files.files[0].path }}" |
79 | 67 | sha256: "{{ file_stats.stat.checksum }}" |
80 | 68 | relative_path: "{{ found_files.files[0].path | basename }}" |
81 | 69 | state: present |
| 70 | + repository: "{{ repository_name }}" |
82 | 71 | register: file_content_result |
83 | 72 | until: file_content_result is success |
84 | 73 | retries: 3 |
85 | 74 | delay: 5 |
86 | 75 |
|
87 | | - - name: Create checksum content from artifact |
| 76 | + - name: Upload checksum |
88 | 77 | pulp.squeezer.file_content: |
89 | 78 | pulp_url: "{{ remote_pulp_url }}" |
90 | 79 | username: "{{ remote_pulp_username }}" |
91 | 80 | password: "{{ remote_pulp_password }}" |
| 81 | + file: "/tmp/{{ found_files.files[0].path | basename }}.sha256" |
92 | 82 | sha256: "{{ checksum_stats.stat.checksum }}" |
93 | 83 | relative_path: "{{ found_files.files[0].path | basename }}.sha256" |
94 | 84 | state: present |
| 85 | + repository: "{{ repository_name }}" |
95 | 86 | register: checksum_content_result |
96 | 87 | until: checksum_content_result is success |
97 | 88 | retries: 3 |
98 | 89 | delay: 5 |
99 | 90 | when: upload_checksum |
100 | 91 |
|
101 | | - - name: Ensure file repo exists |
102 | | - pulp.squeezer.file_repository: |
103 | | - pulp_url: "{{ remote_pulp_url }}" |
104 | | - username: "{{ remote_pulp_username }}" |
105 | | - password: "{{ remote_pulp_password }}" |
106 | | - name: "{{ repository_name }}" |
107 | | - state: present |
108 | | - register: file_repo_result |
109 | | - until: file_repo_result is success |
110 | | - retries: 3 |
111 | | - delay: 5 |
112 | | - |
113 | | - - name: Add content to file repo |
114 | | - pulp.squeezer.file_repository_content: |
115 | | - pulp_url: "{{ remote_pulp_url }}" |
116 | | - username: "{{ remote_pulp_username }}" |
117 | | - password: "{{ remote_pulp_password }}" |
118 | | - repository: "{{ repository_name }}" |
119 | | - present_content: |
120 | | - - relative_path: "{{ found_files.files[0].path | basename }}" |
121 | | - sha256: "{{ file_stats.stat.checksum }}" |
122 | | - register: file_repo_content_result |
123 | | - until: file_repo_content_result is success |
124 | | - retries: 3 |
125 | | - delay: 5 |
126 | | - |
127 | | - - name: Add checksum content to file repo |
128 | | - pulp.squeezer.file_repository_content: |
129 | | - pulp_url: "{{ remote_pulp_url }}" |
130 | | - username: "{{ remote_pulp_username }}" |
131 | | - password: "{{ remote_pulp_password }}" |
132 | | - repository: "{{ repository_name }}" |
133 | | - present_content: |
134 | | - - relative_path: "{{ found_files.files[0].path | basename }}.sha256" |
135 | | - sha256: "{{ checksum_stats.stat.checksum }}" |
136 | | - register: checksum_repo_content_result |
137 | | - until: checksum_repo_content_result is success |
138 | | - retries: 3 |
139 | | - delay: 5 |
140 | | - when: upload_checksum |
141 | | - |
142 | 92 | - name: Create a new publication to point to this version |
143 | 93 | pulp.squeezer.file_publication: |
144 | 94 | pulp_url: "{{ remote_pulp_url }}" |
|
0 commit comments