File tree Expand file tree Collapse file tree
linux_os/guide/system/software/updating/ensure_redhat_gpgkey_installed Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 failed_when : False
2020 check_mode : no
2121 register : gpg_fingerprints
22+ when : ansible_distribution_version is version('10.1', '>=')
23+
24+ - name : " {{{ rule_title }}}: Read signatures in GPG key"
25+ # According to /usr/share/doc/gnupg2/DETAILS fingerprints are in "fpr" record in field 10
26+ ansible.builtin.command : gpg --show-keys --with-fingerprint --with-colons "/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release"
27+ changed_when : False
28+ register : gpg_fingerprints
29+ failed_when : False
30+ check_mode : no
31+ when : ansible_distribution_version is version('10.1', '<')
2232
2333- name : " {{{ rule_title }}}: Set Fact - Installed GPG Fingerprints (sq format)"
2434 ansible.builtin.set_fact :
Original file line number Diff line number Diff line change 1717 # If they are safe, try to obtain fingerprints from the key file
1818 # (to ensure there won't be e.g. CRC error).
1919{{% if " rhel" in families and major_version_ordinal > = 10 %}}
20- readarray -t GPG_OUT < <( sq inspect " $REDHAT_RELEASE_KEY " | grep Fingerprint: | cut -d " :" -f 2)
20+ if {{{ bash_os_linux_conditional(" rhel" , expected_ver=" 10.1" , op=" >=" ) | trim }}}
21+ then
22+ readarray -t GPG_OUT < <( sq inspect " $REDHAT_RELEASE_KEY " | grep Fingerprint: | cut -d " :" -f 2)
23+ else
24+ readarray -t GPG_OUT < <( gpg --show-keys --with-fingerprint --with-colons " $REDHAT_RELEASE_KEY " | grep -A1 " ^pub" | grep " ^fpr" | cut -d " :" -f 10)
25+ fi
2126{{% else %}}
2227 readarray -t GPG_OUT < <( gpg --show-keys --with-fingerprint --with-colons " $REDHAT_RELEASE_KEY " | grep -A1 " ^pub" | grep " ^fpr" | cut -d " :" -f 10)
2328{{% endif %}}
You can’t perform that action at this time.
0 commit comments