Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip downlaoding the gpg if it's already trusted #58

Open
alex opened this issue Sep 14, 2015 · 5 comments
Open

Skip downlaoding the gpg if it's already trusted #58

alex opened this issue Sep 14, 2015 · 5 comments

Comments

@alex
Copy link

alex commented Sep 14, 2015

This saves on a network round trip (which increases reliability)

@hut8
Copy link

hut8 commented Jun 22, 2016

I'm having a lot of reliability issues with the key server which is making deploys less fun:

fatal: [example.com]: FAILED! => {"changed": false, "cmd": ["gpg", "--keyserver", "hkp://keys.gnupg.net", "--recv-keys", "D39DC0E3"], "delta": "0:00:00.060225", "end": "2016-06-21 22:57:35.806555", "failed": true, "rc": 2, "start": "2016-06-21 22:57:35.746330", "stderr": "gpg: requesting key D39DC0E3 from hkp server keys.gnupg.net\ngpg: no valid OpenPGP data found.\ngpg: Total number processed: 0", "stdout": "gpgkeys: key D39DC0E3 can't be retrieved", "stdout_lines": ["gpgkeys: key D39DC0E3 can't be retrieved"], "warnings": []}

I can work on this tomorrow.

@georf
Copy link

georf commented Jul 17, 2018

Do you have an idea to do that?

@pjnagel
Copy link

pjnagel commented Feb 15, 2019

@georf

Note that the workaround for #196 which I posted on that issue also contains an example of not downloading a key when the key is already trusted.

@georf
Copy link

georf commented Feb 15, 2019

Thank you. I lost track of it. I did this at my code:

- name: Check imported GPG keys
  command: 'gpg --no-tty --list-keys {{ item }}'
  changed_when: False
  check_mode: False
  when: not ansible_check_mode
  register: gpg_result
  retries: 5
  delay: 5
  ignore_errors: True
  with_items: '{{ rvm1_gpg_keys }}'

- name: Import GPG keys
  command: 'gpg --no-tty --keyserver {{ rvm1_gpg_key_server }} --recv-keys {{ item.item }}'
  when: not ansible_check_mode and item.rc != 0 
  with_items: '{{ gpg_result.results }}'

For this the rvm1_gpg_keys variable have to be an array.

@mcg
Copy link

mcg commented May 22, 2019

TASK [rvm : Import GPG keys from keyservers] can be super slow at times. Would love to see this change implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants