ignore errors on 'Check that the secret key exists' task

If the grep for gpg_key_id fails to match we will have an exit code of 1 which by
default will cause the task to fail. According to the README, using a gpg key is considered optional. So we don't want the build to halt in this case.
This commit is contained in:
Charlie O'Keefe 2018-04-12 14:19:22 -06:00
parent 90151b3471
commit 6e99c732e9
1 changed files with 1 additions and 0 deletions

View File

@ -1,6 +1,7 @@
---
- name: Check that the secret key exists.
local_action: "shell gpg2 --list-secret-keys --with-colons | grep {{ gpg_key_id }}"
ignore_errors: true
register: gpg_list_keys_result
environment:
GNUPGHOME: "{{ lookup('env', 'HOME') }}/.gnupg"