Skip to content

Commit

Permalink
Be more explicit about gpg2 and...
Browse files Browse the repository at this point in the history
 - Allow for configuration of gpg command
 - New variable:
   `rocket_chat_pgp_command`: gpg2 (default)
 - Can be absolute path or in $PATH
  • Loading branch information
xenithorb committed Feb 28, 2018
1 parent db1b789 commit 46ffcc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ rocket_chat_tarball_check_checksum: false
rocket_Chat_tarball_check_pgp: true
rocket_chat_tarball_fetch_timeout: 100
rocket_chat_tarball_validate_remote_cert: true
rocket_chat_pgp_command: gpg2
rocket_chat_service_user: rocketchat
rocket_chat_service_group: rocketchat
rocket_chat_service_host: "{{ ansible_fqdn }}"
Expand Down
10 changes: 6 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@
- name: Setup PGP for verifying the Rocket.Chat tarball
block:

- name: Import RochetChat PGP Key from default keyservers
- name: "Import RochetChat PGP Key from keyserver: {{ rocket_chat_tarball_gpg_keyserver }}"
shell: |
gpg --keyserver "{{ rocket_chat_tarball_gpg_keyserver }}" \
{{ rocket_chat_pgp_command }} \
--keyserver "{{ rocket_chat_tarball_gpg_keyserver }}" \
--recv-keys "{{ rocket_chat_tarball_gpg_key }}"
register: add_key
changed_when: "'not changed' not in add_key.stderr"
Expand Down Expand Up @@ -183,8 +184,9 @@

- name: Verify Rocket.Chat binary tarball with GPG
shell: |
gpg --verify rocket.chat-{{ rocket_chat_version }}.asc \
rocket.chat-{{ rocket_chat_version }}.tgz
{{ rocket_chat_pgp_command }} \
--verify rocket.chat-{{ rocket_chat_version }}.asc \
rocket.chat-{{ rocket_chat_version }}.tgz
args:
chdir: "{{ rocket_chat_application_path }}"
when: rocket_Chat_tarball_check_pgp
Expand Down

0 comments on commit 46ffcc3

Please sign in to comment.