Skip to content

Conversation

Alex-Welsh
Copy link
Member

This change allows the pulp container/repo playbooks for syncing and publishing to be configured using ansible facts.

Recent changes use facts to set the Ceph images, which therefore fails.

   The conditional check 'pulp_repository_container_repos | length > 0' failed. The error was: error while evaluating conditional (pulp_repository_container_repos | length > 0): {{ stackhpc_pulp_repository_container_repos }}:{{(stackhpc_pulp_repository_container_repos_kolla + stackhpc_pulp_repository_container_repos_ceph) | selectattr('required') }}: [AnsibleMapping([('name', 'ceph/ceph'), ('url', 'https://quay.io'), ('policy', 'on_demand'), ('proxy_url', '{{ pulp_proxy_url }}'), ('state', 'present'), ('include_tags', '{{ cephadm_image_tag }}'), ('required', '{{ stackhpc_sync_ceph_images | bool }}')])]: {{'v17.2.6' if ansible_facts['distribution_release'] == 'jammy' else 'v16.2.11' }}: 'dict object' has no attribute 'distribution_release'

The alternative would be to replace the cephadm_image_tag conditional with something based on os_release

@Alex-Welsh Alex-Welsh requested a review from a team as a code owner May 23, 2023 14:11
@markgoddard
Copy link
Contributor

Let's instead switch to use os_distribution/os_release

@Alex-Welsh Alex-Welsh changed the title Enable gather_facts for pulp playbooks Fix cephadm image tag conditional error May 24, 2023
@Alex-Welsh Alex-Welsh force-pushed the patch-ceph-version-error branch from 6212849 to db2f18e Compare May 24, 2023 15:06
@Alex-Welsh
Copy link
Member Author

Untested for now

@priteau
Copy link
Member

priteau commented May 24, 2023

Please update the commit message to match the new code change.

Ansible facts are not guaranteed to be available when the
cephadm_image_tag value needs to be evaluated. This change makes it
conditional on the os_release instead.
@Alex-Welsh Alex-Welsh force-pushed the patch-ceph-version-error branch from db2f18e to d793df1 Compare May 24, 2023 15:29
@Alex-Welsh
Copy link
Member Author

Please update the commit message to match the new code change.

Good point. Should be fixed now

@markgoddard markgoddard merged commit 9e56bb3 into stackhpc/yoga May 25, 2023
@markgoddard markgoddard deleted the patch-ceph-version-error branch May 25, 2023 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants