jgeusebroek / ansible-role-maxmind-geoip

An Ansible Role that installs and configures the Maxmind GeoIP databases
4 stars 9 forks source link

The "Add Maxmind PPA repository | Ubuntu" task fails in an LXC container(missing GnuPG) #10

Closed brlin-tw closed 3 years ago

brlin-tw commented 3 years ago
TASK [jgeusebroek.maxmind_geoip : Add Maxmind PPA repository | Ubuntu] *************************************************************
fatal: [geoip-update]: FAILED! => {"changed": false, "cmd": "apt-key export F44B38CE3DB1BF64B61DBD28DE1997DCDE742AFA", "msg": "E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation", "rc": 255, "stderr": "E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation\n", "stderr_lines": ["E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation"], "stdout": "", "stdout_lines": []}

It appears that the role itself doesn't install the package, which is rather done in the Ansible Molecule testing playbook(?):

https://github.com/jgeusebroek/ansible-role-maxmind-geoip/blob/c5f7989cdc9f884f4639f4b3dc156109869078a3/molecule/default/prepare.yml#L5-L11

IMO the role should always satisfy whatever runtime dependencies it needed by installing appropriate packages, which means the package installation should happen in the role instead.

jgeusebroek commented 3 years ago

Most distributions have this installed by default. This works for me.