I'm trying to remove apt_key
I added using ansible
- Adding the gpg key
- name: Ensure an helm signing key is present
apt_key:
url: https://baltocdn.com/helm/signing.asc
become: true
and this is what I want to do
- Deleting the gpg key
- name: Ensure helm signing key is removed
apt_key:
url: https://baltocdn.com/helm/signing.asc
state: absent
become: true
- Output
fatal: [master]: FAILED! => {"changed": false, "msg": "key is required"}
My question is, is there an ansible module way to get the key
value or only using command
to extract the value from apt_key list
? any suggestion, please.
It will be very helpful for me if you include a code sample as well. Thank you.
question from:https://stackoverflow.com/questions/65910162/ansible-removing-gpg-key-on-ubuntu