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

Fallback to alternative GPG key servers #192

Merged
merged 8 commits into from
Dec 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Changelog

### NEXT
* ...

### 2.1.1
* Fallback to alternative GPG key servers (#192)
* Remove keys.gnupg.net in favour of pool.sks-keyservers.net (#192)

### 2.1.1
2018-12-18

* Fix RVM verification process after changing `command` to `shell`

### 2.1.0
### 2.1.0
2018-12-18

* Support centos6 and centos7
Expand All @@ -19,9 +21,11 @@
* Include pkuczynski gpg key (#189)

### 2.0.1

* Fix issue `src file does not exist` cause by testrb

### 2.0.0

* Bump ansible version to 2.2
* Update readme

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ rvm1_rvm_check_for_updates: True
rvm1_gpg_keys: '409B6B1796C275462A1703113804BB82D39DC0E3'

# The GPG key server
rvm1_gpg_key_server: 'hkp://keys.gnupg.net'
rvm1_gpg_key_server: 'hkp://pool.sks-keyservers.net'

# autolib mode, see https://rvm.io/rvm/autolibs
rvm1_autolib_mode: 3
Expand Down
9 changes: 8 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ rvm1_rvm_check_for_updates: True
rvm1_gpg_keys: '409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB'

# The GPG key server
rvm1_gpg_key_server: 'hkp://keys.gnupg.net'
rvm1_gpg_key_server: 'hkp://pool.sks-keyservers.net'

# The GPG alternative key servers
rvm1_gpg_key_servers:
- '{{ rvm1_gpg_key_server }}'
- hkp://ipv4.pool.sks-keyservers.net
- hkp://pgp.mit.edu
- hkp://keyserver.pgp.com

# autolib mode, see https://rvm.io/rvm/autolibs
rvm1_autolib_mode: 3
Expand Down
25 changes: 14 additions & 11 deletions tasks/rvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,26 @@
mode: 0755
when: not rvm_installer.stat.exists

- name: Import GPG keys
shell: 'gpg --batch --keyserver {{ rvm1_gpg_key_server }} --recv-keys {{ rvm1_gpg_keys }}'
- name: Import GPG keys from keyservers
shell: 'gpg --batch --keyserver {{ item }} --recv-keys {{ rvm1_gpg_keys }}'
changed_when: False
check_mode: False
when: not ansible_check_mode and rvm1_gpg_keys != ''
register: gpg_result
until: gpg_result.rc == 0
retries: 5
delay: 5
with_items: '{{ rvm1_gpg_key_servers }}'
register: gpg_import
when: not ansible_check_mode and rvm1_gpg_keys != '' and (gpg_import is not defined or gpg_import.rc != 0)
ignore_errors: True

- name: Import GPG keys the other way
- name: Was GPG import from keyservers succesfull?
set_fact: gpg_imported_from={{ item.item }}
when: "'rc' in item and item.rc == 0"
with_items: "{{ gpg_import.results }}"

- name: Import GPG keys from rvm.io, if keyservers failed
shell: 'curl -sSL https://rvm.io/{{ item }} | gpg --batch --import -'
with_items:
- mpapis.asc
- pkuczynski.asc
when: not ansible_check_mode and rvm1_gpg_keys != '' and gpg_result.rc != 0
- mpapis.asc
- pkuczynski.asc
when: not ansible_check_mode and rvm1_gpg_keys != '' and gpg_imported_from is not defined

- name: Install rvm
shell: >
Expand Down