Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible.builtin.apt_key module doesn't work with binary gpg keys in ansible v4.0.0 #74770

Closed
1 task done
dmitryax opened this issue May 19, 2021 · 3 comments
Closed
1 task done
Labels
affects_2.12 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@dmitryax
Copy link

Summary

Using ansible.builtin.apt_key to import a binary gpg key started failing with release of ansible 4.0.0. It works well on other versions of ansible 2.9+.

Issue Type

Bug Report

Component Name

apt_key

Ansible Version

ansible [core 2.11.0]
  config file = None
  configured module search path = ['/Users/danoshin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /Users/danoshin/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.5 (default, May  4 2021, 03:33:11) [Clang 12.0.0 (clang-1200.0.32.29)]
  jinja version = 2.11.3
  libyaml = True

Configuration

(empty)

OS / Environment

control host: MacOS 10.15.7
remove host: Ubuntu 20.04.2 LTS

Steps to Reproduce

Try to add any binary gpg key:

    - name: Add binary key
      apt_key: 
        url: https://packages.cloud.google.com/apt/doc/apt-key.gpg

Expected Results

The gpg key added to the keyring

Actual Results

TASK [Add binary key] **********************************************************************************************************************************************************************************************************************************************************
fatal: [ubuntu]: FAILED! => {"changed": false, "msg": "Unable to extract key from '-'", "stderr": "gpg: directory '/root/.gnupg' created\ngpg: keybox '/root/.gnupg/pubring.kbx' created\ngpg: WARNING: no command supplied.  Trying to guess what you mean ...\ngpg: /root/.gnupg/trustdb.gpg: trustdb created\ngpg: [don't know]: invalid packet (ctb=0a)\n", "stderr_lines": ["gpg: directory '/root/.gnupg' created", "gpg: keybox '/root/.gnupg/pubring.kbx' created", "gpg: WARNING: no command supplied.  Trying to guess what you mean ...", "gpg: /root/.gnupg/trustdb.gpg: trustdb created", "gpg: [don't know]: invalid packet (ctb=0a)"], "stdout": "pub:-:2048:1:FEEA9169307EA071:1614614617:1677728521::-:\nuid:::::::::Rapture Automatic Signing Key (cloud-rapture-signing-key-2021-03-01-08_01_09.pub):\nsub:-:2048:1:AA42F36EE8BEEE0E:1614614617::::\npub:-:2048:1:8B57C5C2836F4BEB:1607040606:1670154510::-:\nuid:::::::::gLinux Rapture Automatic Signing Key (//depot/google3/production/borg/cloud-rapture/keys/cloud-rapture-pubkeys/cloud-rapture-signing-key-2020-12-03-16_08_05.pub) <glinux-team@google.com>:\nsub:-:2048:1:48419E688DD52AC0:1607040606::::\n", "stdout_lines": ["pub:-:2048:1:FEEA9169307EA071:1614614617:1677728521::-:", "uid:::::::::Rapture Automatic Signing Key (cloud-rapture-signing-key-2021-03-01-08_01_09.pub):", "sub:-:2048:1:AA42F36EE8BEEE0E:1614614617::::", "pub:-:2048:1:8B57C5C2836F4BEB:1607040606:1670154510::-:", "uid:::::::::gLinux Rapture Automatic Signing Key (//depot/google3/production/borg/cloud-rapture/keys/cloud-rapture-pubkeys/cloud-rapture-signing-key-2020-12-03-16_08_05.pub) <glinux-team@google.com>:", "sub:-:2048:1:48419E688DD52AC0:1607040606::::"]}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibot
Copy link
Contributor

ansibot commented May 19, 2021

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.

click here for bot help

@ansibot ansibot added affects_2.12 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels May 19, 2021
@sivel
Copy link
Member

sivel commented May 19, 2021

This has been resolved in #74474 and will be included in the upcoming ansible-core 2.11.1 release on May 24.

If you have further questions please stop by IRC or the mailing list:

@sivel sivel closed this as completed May 19, 2021
@dmitryax
Copy link
Author

Thanks! Confirmed using v2.11.1rc1 release

@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label May 20, 2021
@ansible ansible locked and limited conversation to collaborators Jun 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.12 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

4 participants