Skip to content

Commit ca385f7

Browse files
Merge pull request #14604 from ggbecker/fix-ansible-missing-variable
Use separate ansible variables for sq and gpg
2 parents 5bef607 + 93e1c75 commit ca385f7

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

  • linux_os/guide/system/software/updating/ensure_redhat_gpgkey_installed/ansible

linux_os/guide/system/software/updating/ensure_redhat_gpgkey_installed/ansible/shared.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
changed_when: false
1919
failed_when: False
2020
check_mode: no
21-
register: gpg_fingerprints
21+
register: sq_fingerprints
22+
when: ansible_distribution_version is version('10.1', '>=')
23+
24+
- name: "{{{ rule_title }}}: Set Fact - Installed GPG Fingerprints (sq format)"
25+
ansible.builtin.set_fact:
26+
gpg_installed_fingerprints: "{{ sq_fingerprints.stdout | regex_findall('Fingerprint:\\s*([0-9A-Fa-f]+)', '\\1') | list }}"
2227
when: ansible_distribution_version is version('10.1', '>=')
2328

2429
- name: "{{{ rule_title }}}: Read signatures in GPG key"
@@ -30,9 +35,10 @@
3035
check_mode: no
3136
when: ansible_distribution_version is version('10.1', '<')
3237

33-
- name: "{{{ rule_title }}}: Set Fact - Installed GPG Fingerprints (sq format)"
38+
- name: "{{{ rule_title }}}: Set Fact - Installed GPG Fingerprints (gpg format)"
3439
ansible.builtin.set_fact:
35-
gpg_installed_fingerprints: "{{ gpg_fingerprints.stdout | regex_findall('Fingerprint:\\s*([0-9A-Fa-f]+)', '\\1') | list }}"
40+
gpg_installed_fingerprints: "{{ gpg_fingerprints.stdout | regex_findall('^pub.*\\n(?:^fpr[:]*)([0-9A-Fa-f]*)', '\\1') | list }}"
41+
when: ansible_distribution_version is version('10.1', '<')
3642
{{% else %}}
3743
# RHEL 8, 9 and other versions: Use gpg command
3844

0 commit comments

Comments
 (0)