Skip to content

Commit 2c5c3ab

Browse files
committed
M #-: Fix GPG key checks with asymmetric repos_enabled distribution (#196)
Signed-off-by: Michal Opala <sk4zuzu@gmail.com>
1 parent 499aab2 commit 2c5c3ab

4 files changed

Lines changed: 16 additions & 8 deletions

File tree

roles/repository/tasks/ceph.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
get_attributes: false
1515
get_checksum: false
1616
get_mime: false
17-
register: stat
17+
register: stat_ceph_gpg
1818

1919
# NOTE: GPG keys are downloaded when any of them is missing on any of the play hosts.
2020
# That way we make sure:
2121
# - the key is downloaded only once and only when necessary
2222
# - keys are identical everywhere
2323
- when: repo_constraints.ceph.hosts | select('in', ansible_play_batch)
24-
| map('extract', hostvars, ['stat', 'stat', 'exists']) is not all
24+
| map('extract', hostvars)
25+
| selectattr('stat_ceph_gpg.stat.exists', 'defined')
26+
| map(attribute='stat_ceph_gpg.stat.exists') is not all
2527
block:
2628
- name: Download Ceph GPG key (once)
2729
ansible.builtin.uri:

roles/repository/tasks/frr.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
get_attributes: false
1515
get_checksum: false
1616
get_mime: false
17-
register: stat
17+
register: stat_frr_gpg
1818

1919
# NOTE: GPG keys are downloaded when any of them is missing on any of the play hosts.
2020
# That way we make sure:
2121
# - the key is downloaded only once and only when necessary
2222
# - keys are identical everywhere
2323
- when: repo_constraints.frr.hosts | select('in', ansible_play_batch)
24-
| map('extract', hostvars, ['stat', 'stat', 'exists']) is not all
24+
| map('extract', hostvars)
25+
| selectattr('stat_frr_gpg.stat.exists', 'defined')
26+
| map(attribute='stat_frr_gpg.stat.exists') is not all
2527
block:
2628
- name: Download Free Range Routing GPG key (once)
2729
ansible.builtin.uri:

roles/repository/tasks/grafana.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
get_attributes: false
1515
get_checksum: false
1616
get_mime: false
17-
register: stat
17+
register: stat_grafana_gpg
1818

1919
# NOTE: GPG keys are downloaded when any of them is missing on any of the play hosts.
2020
# That way we make sure:
2121
# - the key is downloaded only once and only when necessary
2222
# - keys are identical everywhere
2323
- when: repo_constraints.grafana.hosts | select('in', ansible_play_batch)
24-
| map('extract', hostvars, ['stat', 'stat', 'exists']) is not all
24+
| map('extract', hostvars)
25+
| selectattr('stat_grafana_gpg.stat.exists', 'defined')
26+
| map(attribute='stat_grafana_gpg.stat.exists') is not all
2527
block:
2628
- name: Download Grafana GPG key (once)
2729
ansible.builtin.uri:

roles/repository/tasks/opennebula.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@
5353
get_attributes: false
5454
get_checksum: false
5555
get_mime: false
56-
register: stat
56+
register: stat_opennebula_gpg
5757

5858
# NOTE: GPG keys are downloaded when any of them is missing on any of the play hosts.
5959
# That way we make sure:
6060
# - the key is downloaded only once and only when necessary
6161
# - keys are identical everywhere
6262
- when: repo_constraints.opennebula.hosts | select('in', ansible_play_batch)
63-
| map('extract', hostvars, ['stat', 'stat', 'exists']) is not all
63+
| map('extract', hostvars)
64+
| selectattr('stat_opennebula_gpg.stat.exists', 'defined')
65+
| map(attribute='stat_opennebula_gpg.stat.exists') is not all
6466
block:
6567
- name: Download OpenNebula GPG key (once)
6668
ansible.builtin.uri:

0 commit comments

Comments
 (0)