Skip to content

Commit 18aa268

Browse files
authored
Merge pull request #22 from stackhpc/deb-extras
Debian extras
2 parents b3b9e27 + 229e5ba commit 18aa268

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

roles/pulp_distribution/tasks/deb.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@
1515
validate_certs: "{{ pulp_validate_certs | bool }}"
1616
register: pulp_pubs_list
1717

18+
# Verbatim publications use a different API endpoint than regular Deb
19+
# publications.
20+
- name: Query verbatim publications
21+
pulp.squeezer.deb_publication:
22+
pulp_url: "{{ pulp_url }}"
23+
username: "{{ pulp_username }}"
24+
password: "{{ pulp_password }}"
25+
validate_certs: "{{ pulp_validate_certs | bool }}"
26+
mode: "verbatim"
27+
register: pulp_verbatim_pubs_list
28+
1829
- name: Query distributions
1930
pulp.squeezer.deb_distribution:
2031
pulp_url: "{{ pulp_url }}"
@@ -26,13 +37,14 @@
2637
- name: Ensure Deb distributions are defined
2738
vars:
2839
repo: "{{ pulp_repos_list.repositories | selectattr('name', 'equalto', item.repository) | first }}"
40+
all_pubs_list: "{{ pulp_pubs_list.publications + pulp_verbatim_pubs_list.publications }}"
2941
# If the distribution references a specific version:
30-
specific_pub: "{{ pulp_pubs_list.publications | selectattr('repository_version', 'equalto', repo.pulp_href ~ 'versions/' ~ item.version | default ~ '/') }}"
42+
specific_pub: "{{ all_pubs_list | selectattr('repository_version', 'equalto', repo.pulp_href ~ 'versions/' ~ item.version | default ~ '/') }}"
3143
# If the distribution uses the latest version:
32-
latest_pub: "{{ pulp_pubs_list.publications | selectattr('repository', 'equalto', repo.pulp_href) | stackhpc.pulp.sort_publications }}"
44+
latest_pub: "{{ all_pubs_list | selectattr('repository', 'equalto', repo.pulp_href) | stackhpc.pulp.sort_publications }}"
3345
# If another distribution is being promoted to this one:
3446
promoted_dist: "{{ pulp_dists_list.distributions | selectattr('name', 'equalto', item.distribution | default) }}"
35-
promoted_pub: "{{ pulp_pubs_list.publications | selectattr('pulp_href', 'equalto', (promoted_dist | first).publication | default) }}"
47+
promoted_pub: "{{ all_pubs_list | selectattr('pulp_href', 'equalto', (promoted_dist | first).publication | default) }}"
3648
# Pick the right publication based on the type of distribution.
3749
pubs: "{{ specific_pub if item.version is defined else promoted_pub if item.distribution is defined else latest_pub }}"
3850
# Whether any distributions exist for this publication.

roles/pulp_publication/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ Example playbook
3030
# Create a publication of the latest version.
3131
- repository: ubuntu-focal
3232
state: present
33-
# Create a publication of version 2.
33+
# Create a publication of version 2 using structured mode.
3434
- repository: ubuntu-focal
3535
version: 2
36+
mode: structured
3637
state: present
3738
pulp_publication_rpm:
3839
# Create a publication of the latest version.

roles/pulp_publication/tasks/deb.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
repository: "{{ item.repository }}"
99
state: "{{ item.state }}"
1010
version: "{{ item.version | default(omit) }}"
11+
mode: "{{ item.mode | default(omit) }}"
1112
with_items: "{{ pulp_publication_deb }}"

roles/pulp_repository/tasks/deb.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@
3232
validate_certs: "{{ pulp_validate_certs | bool }}"
3333
repository: "{{ item.name }}"
3434
remote: "{{ item.name }}-remote"
35+
mirror: "{{ item.mirror | default(omit) }}"
3536
with_items: "{{ pulp_repository_deb_repos }}"
3637
when: item.state == "present"

0 commit comments

Comments
 (0)