|
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 | + |
31 | 43 | - name: Get sha256 hash |
32 | 44 | ansible.builtin.stat: |
33 | 45 | path: "{{ found_files.files[0].path }}" |
|
46 | 58 | checksum_algorithm: sha256 |
47 | 59 | register: checksum_stats |
48 | 60 |
|
49 | | - - name: Ensure file repo exists |
50 | | - pulp.squeezer.file_repository: |
| 61 | + - name: Upload checksum artifact |
| 62 | + pulp.squeezer.artifact: |
51 | 63 | pulp_url: "{{ remote_pulp_url }}" |
52 | 64 | username: "{{ remote_pulp_username }}" |
53 | 65 | password: "{{ remote_pulp_password }}" |
54 | | - name: "{{ repository_name }}" |
| 66 | + file: "/tmp/{{ found_files.files[0].path | basename }}.sha256" |
55 | 67 | state: present |
56 | | - register: file_repo_result |
57 | | - until: file_repo_result is success |
| 68 | + register: checksum_upload_result |
| 69 | + until: checksum_upload_result is success |
58 | 70 | retries: 3 |
59 | | - delay: 5 |
| 71 | + delay: 60 |
| 72 | + when: upload_checksum |
60 | 73 |
|
61 | | - - name: Upload artifact |
| 74 | + - name: Create file content from artifact |
62 | 75 | pulp.squeezer.file_content: |
63 | 76 | pulp_url: "{{ remote_pulp_url }}" |
64 | 77 | username: "{{ remote_pulp_username }}" |
65 | 78 | password: "{{ remote_pulp_password }}" |
66 | | - file: "{{ found_files.files[0].path }}" |
67 | 79 | sha256: "{{ file_stats.stat.checksum }}" |
68 | 80 | relative_path: "{{ found_files.files[0].path | basename }}" |
69 | 81 | state: present |
70 | | - repository: "{{ repository_name }}" |
71 | 82 | register: file_content_result |
72 | 83 | until: file_content_result is success |
73 | 84 | retries: 3 |
74 | 85 | delay: 5 |
75 | 86 |
|
76 | | - - name: Upload checksum |
| 87 | + - name: Create checksum content from artifact |
77 | 88 | pulp.squeezer.file_content: |
78 | 89 | pulp_url: "{{ remote_pulp_url }}" |
79 | 90 | username: "{{ remote_pulp_username }}" |
80 | 91 | password: "{{ remote_pulp_password }}" |
81 | | - file: "/tmp/{{ found_files.files[0].path | basename }}.sha256" |
82 | 92 | sha256: "{{ checksum_stats.stat.checksum }}" |
83 | 93 | relative_path: "{{ found_files.files[0].path | basename }}.sha256" |
84 | 94 | state: present |
85 | | - repository: "{{ repository_name }}" |
86 | 95 | register: checksum_content_result |
87 | 96 | until: checksum_content_result is success |
88 | 97 | retries: 3 |
89 | 98 | delay: 5 |
90 | 99 | when: upload_checksum |
91 | 100 |
|
| 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 | + |
92 | 142 | - name: Create a new publication to point to this version |
93 | 143 | pulp.squeezer.file_publication: |
94 | 144 | pulp_url: "{{ remote_pulp_url }}" |
|
0 commit comments