I have been trying to create a percona role in ansible and failing at it. I won't really say failing but it doesn't work as planned. Below is a snippet of the role
- name: Setting up percona server apt-key
apt_key:
id=1C4CBDCDCD2EFD2A
keyserver=keys.gnupg.net
state=present
Upon running this I ended up with the following error:
failed: [192.168.56.107] => {"cmd": "apt-key adv --keyserver keys.gnupg.net --recv 1C4CBDCDCD2EFD2A", "failed": true, "rc": 2}
stderr: gpg: requesting key CD2EFD2A from hkp server keys.gnupg.net
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
As you can see ansible executes the following command: apt-key adv --keyserver keys.gnupg.net --recv 1C4CBDCDCD2EFD2A
, meanwhile the command that actually works, tested and recommended from percona repository page
is apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
. There is a difference in the commands the former is just --recv and the latter is --recv-keys. I have no idea how to make ansible run this commands either can using the ansible command module itself.
There is also this url found on percona download page to the repo key which can be used in the apt_key module instead of keyserver.
What I am interested in knowing is whether it's possible to make ansible run the actual apt_key commands with --recv-keys