alvistack / ansible-role-podman

Ansible Role for Podman Installation
Apache License 2.0
57 stars 6 forks source link

Ensure GPG is installed #8

Closed dmotte closed 1 year ago

dmotte commented 1 year ago

Hi, first of all thanks for creating this role! πŸ™‚ very useful

On the first attempt it failed on my system (Debian 11) because i didn't have the gpg package installed:

TASK [alvistack.podman : apt-key add] ******************************************
FAILED - RETRYING: [default]: apt-key add (3 retries left).
FAILED - RETRYING: [default]: apt-key add (2 retries left).
FAILED - RETRYING: [default]: apt-key add (1 retries left).
failed: [default] (item={'keyring': '/etc/apt/trusted.gpg.d/home_alvistack.gpg', 'url': 'http://downloadcontent.opensuse.org/repositories/home:/alvistack/Debian_11/Release.key', 'id': '789CFFDE0295B8A1F4E5690C4BECC97550D0B1FD', 'state': 'present'}) => {"ansible_loop_var": "item", "attempts": 3, "changed": false, "item": {"id": "789CFFDE0295B8A1F4E5690C4BECC97550D0B1FD", "keyring": "/etc/apt/trusted.gpg.d/home_alvistack.gpg", "state": "present", "url": "http://downloadcontent.opensuse.org/repositories/home:/alvistack/Debian_11/Release.key"}, "msg": "Failed to find required executable \"gpg\" in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}

Installing it with apt-get install -y gpg solved the problem. It would be nice if the role ensures this by itself :) It is as simple as adding gpg to the _apt list here: https://github.com/alvistack/ansible-role-podman/blob/master/vars/debian-11.yml#L28

hswong3i commented 1 year ago

IMHO, adding gpg to the _apt list is a bit overkill:

Anyway, I always approach https://en.wikipedia.org/wiki/Unix_philosophy as https://en.wikipedia.org/wiki/Minimalism_(computing) and https://en.wikipedia.org/wiki/Modular_programming if possible (or even say https://en.wikipedia.org/wiki/KISS_principle). Although this is just a simple fix but I will not accept it, sorry and thank you for your kindly understanding.

dmotte commented 1 year ago

OK, I understand πŸ˜‰ thanks a lot for your explanation