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:
parent
c6123f5c1e
commit
1e696ce2be
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue