Git Product home page Git Product logo

Comments (4)

ansibot avatar ansibot commented on July 18, 2024

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the component bot command.

from ansible.

rptaylor avatar rptaylor commented on July 18, 2024

To further debug/confirm the problem I did some debugging on the node and modified this code:

    def is_key_imported(self, keyid):
        cmd = self.rpm + ' -q  gpg-pubkey'
        print(f'Doing command: {cmd}')
        rc, stdout, stderr = self.module.run_command(cmd)
        if rc != 0:  # No key is installed on system
            return False
        cmd += ' --qf "%{description}" | ' + self.gpg + ' --no-tty --batch --with-colons --fixed-list-mode -'
        print(f'Doing command: {cmd}')
        stdout, stderr = self.execute_command(cmd)
        for line in stdout.splitlines():
            if keyid in line.split(':')[4]:
                print(f"Found key {keyid} in line {line.split(':')[4]}")
                return True
        return False

Then I ran it:

$ ./AnsiballZ_rpm_key.py execute
Doing command: /usr/bin/rpm -q  gpg-pubkey
Doing command: /usr/bin/rpm -q  gpg-pubkey --qf "%{description}" | /usr/bin/gpg --no-tty --batch --with-colons --fixed-list-mode -
Found key 488FCF7C3ABB34F8 in line 488FCF7C3ABB34F8
Key already imported, doing nothing

{"changed": false, "invocation": {"module_args": {"state": "present", "key": "https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux", "fingerprint": "BC5E DDCA DF50 2C07 7F15  8288 2AE8 1E8A CED7 258B", "validate_certs": true}}}

For the record:

$ /usr/bin/rpm -q  gpg-pubkey --qf "%{description}" | /usr/bin/gpg --no-tty --batch --with-colons --fixed-list-mode -
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
pub:e:4096:1:488FCF7C3ABB34F8:1610451214:1705059214::-:
uid:::::::::AlmaLinux <[email protected]>:
sub:e:3072:1:51D6647EC21AD6EA:1610451398:1705059398:::

from ansible.

ricardoklein avatar ricardoklein commented on July 18, 2024

I've experienced the same issue this morning while trying to upgrade zabbix to 7.0.
There is a new subkey on https://repo.zabbix.com/zabbix-official-repo.key, and Ansible does not update the key when running the code below, leading to fail when attempting to install the new packages:

    - name: Accept Zabbix GPG Key
      ansible.builtin.rpm_key:
        state: present
        key: https://repo.zabbix.com/zabbix-official-repo.key

Ansible Version:

ansible --version
ansible [core 2.16.7]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/klein/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /home/klein/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.9 (main, Apr 08 2024, 06:18:15) [GCC] (/usr/bin/python3.11)
  jinja version = 3.1.4
  libyaml = True

OS:

cat /etc/os-release | grep ID
ID="opensuse-tumbleweed"
ID_LIKE="opensuse suse"
VERSION_ID="20240610"

from ansible.

t-kranz avatar t-kranz commented on July 18, 2024

Same issue - i think this is a duplicate of #50615 (which is closed) - maybe the PR there (#75251) is salvageable?

from ansible.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.