Skip to content

Commit aa35dbc

Browse files
committed
fix var condition not resolving when RL8 repo doesn't exist
1 parent ccb9b81 commit aa35dbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ansible/roles/dnf_repos/tasks/set_repos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- repo_os in item.value
1818
vars:
1919
repo_os: "{{ ansible_distribution_version if ansible_distribution_version in item.value else ansible_distribution_major_version }}"
20-
repo_values: "{{ item.value[repo_os] }}"
20+
repo_values: "{{ item.value[repo_os] | default({}) }}"
2121
repo_name: "{{ repo_values.repo_name | default(item.key) }}"
2222
repo_content_url: "{{ repo_values.pulp_content_url | default(dnf_repos_pulp_content_url) }}"
2323

@@ -43,6 +43,6 @@
4343
- repo_os in item.value
4444
vars:
4545
repo_os: "{{ ansible_distribution_version if ansible_distribution_version in item.value else ansible_distribution_major_version }}"
46-
repo_values: "{{ item.value[repo_os] }}"
46+
repo_values: "{{ item.value[repo_os] | default({}) }}"
4747
repo_name: "{{ repo_values.repo_name | default(item.key) }}"
4848
repo_content_url: "{{ repo_values.pulp_content_url | default(dnf_repos_pulp_content_url) }}"

0 commit comments

Comments
 (0)