Use 'shell' ansible module in place of 'command'

This is a compound command, piping the output of a call to gpg2 to the input of
a call to grep. This is the type of instruction that requires a shell to interpret, so use
the 'shell' module.
This commit is contained in:
Charlie O'Keefe 2018-04-12 14:04:42 -06:00
parent c6123f5c1e
commit 1e696ce2be
1 changed files with 1 additions and 1 deletions

View File

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