Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible add GPG Keyserver

I need to incorporate these two commands into my ansible script:

  # sudo gpg --keyserver hkp://keys.gnupg.net --recv-keys #######
  # sudo gpg -a --export ####### | sudo apt-key add -

I am referring to this ansible link but I am unable to produce anything that works. I tried this:

apt_key: keyserver=hkp://keys.gnupg.net id=######

and get the following error:

 FAILED! => {"changed": false, "failed": true, "msg": "unsupported parameter for module: keyserver"}

Is there a way to properly add gpg keys with ansible?

like image 677
latencybit Avatar asked Jan 23 '26 20:01

latencybit


1 Answers

Check this link: http://docs.ansible.com/ansible/latest/apt_key_module.html

- name: convert gpg
  shell: "{{ item }}"
  with_items:
    - gpg --keyserver hkp://keys.gnupg.net --recv-keys #######
    - gpg -a --export ####### | sudo apt-key add -
like image 157
Andrew Figaroa Avatar answered Jan 26 '26 09:01

Andrew Figaroa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!