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