Skip to content

Commit 70617e4

Browse files
committed
Rewrite pulp_container_content for updated sqeezer
1 parent 3ec53ad commit 70617e4

File tree

7 files changed

+150
-259
lines changed

7 files changed

+150
-259
lines changed

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
pulp:
19-
- "3.21"
2019
- "3.45"
20+
- "3.81"
2121
steps:
2222
# Checks-out the repository under $GITHUB_WORKSPACE, so it's accessible to the job
2323
- uses: actions/checkout@v3

galaxy.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ namespace: stackhpc
22
name: pulp
33
description: >
44
Roles and plugins Pulp repository server configuration
5-
version: "0.5.5"
5+
version: "0.6.0"
66
readme: "README.md"
77
authors:
88
- "Piotr Parczewski"
99
- "Michał Nasiadka"
1010
- "Mark Goddard"
11+
- "Alex Welsh"
1112
dependencies:
12-
"pulp.squeezer": "*"
13+
"pulp.squeezer": ">=0.20.0"
1314
license:
1415
- "Apache-2.0"
1516
tags:

plugins/modules/pulp_container_content.py

Lines changed: 0 additions & 223 deletions
This file was deleted.
Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,21 @@
11
---
2+
- name: Initialize active tasks list
3+
set_fact:
4+
pulp_container_active_tasks: []
5+
26
- name: Add or remove content units
3-
stackhpc.pulp.pulp_container_content:
4-
pulp_url: "{{ pulp_url }}"
5-
username: "{{ pulp_username }}"
6-
password: "{{ pulp_password }}"
7-
validate_certs: "{{ pulp_validate_certs | bool }}"
8-
allow_missing: "{{ item.allow_missing | default(omit) }}"
9-
is_push: "{{ item.is_push | default(omit) }}"
10-
src_repo: "{{ item.src_repo | default(omit) }}"
11-
src_is_push: "{{ item.src_is_push | default(omit) }}"
12-
repository: "{{ item.repository }}"
13-
tags: "{{ item.tags }}"
14-
state: "{{ item.state | default(omit) }}"
15-
wait: "{{ pulp_container_content_wait | bool }}"
7+
include_tasks: process_content.yml
168
loop: "{{ pulp_container_content }}"
17-
register: pulp_container_content_result
9+
loop_control:
10+
loop_var: content_item
1811

1912
- name: Wait for tasks to complete
2013
pulp.squeezer.task:
2114
pulp_url: "{{ pulp_url }}"
2215
username: "{{ pulp_username }}"
2316
password: "{{ pulp_password }}"
2417
validate_certs: "{{ pulp_validate_certs | bool }}"
25-
pulp_href: "{{ content_result.task.pulp_href }}"
26-
state: "completed"
27-
loop: "{{ pulp_container_content }}"
28-
when:
29-
- not pulp_container_content_wait | bool
30-
- "'task' in content_result"
31-
changed_when: pulp_container_content_wait_result.task.created_resources | default([]) | length > 0
32-
register: pulp_container_content_wait_result
33-
loop_control:
34-
index_var: result_index
35-
vars:
36-
content_result: "{{ pulp_container_content_result.results[result_index] }}"
18+
pulp_href: "{{ item }}"
19+
state: completed
20+
loop: "{{ pulp_container_active_tasks }}"
21+
when: pulp_container_content_wait | bool

0 commit comments

Comments
 (0)