Skip to content

Commit d3531e5

Browse files
committed
pulp_distribution: query deb verbatim publications also
pulp_deb supports two separate publication API endpoints. Query them both.
1 parent 47e260c commit d3531e5

File tree

1 file changed

+15
-3
lines changed
  • roles/pulp_distribution/tasks

1 file changed

+15
-3
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) | sort(attribute='repository_version', reverse=True) }}"
44+
latest_pub: "{{ all_pubs_list | selectattr('repository', 'equalto', repo.pulp_href) | sort(attribute='repository_version', reverse=True) }}"
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.

0 commit comments

Comments
 (0)