From a56a4d66005903c6e20fdad051ccc05e7c99f672 Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Sun, 13 Sep 2020 23:15:28 +0200 Subject: [PATCH] Properly solve ansible-lint 306 warning about shell task with pipe Do not ignore such warnings! They are there for a reason! --- tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 2739330..0bfb739 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -80,7 +80,9 @@ when: wireguard__register_config_file.stat.exists - name: Derive WireGuard public key - shell: "echo '{{ wireguard__fact_private_key }}' | wg pubkey" # noqa 306 + command: "wg pubkey" + args: + stdin: "{{ wireguard__fact_private_key }}" register: wireguard__register_public_key changed_when: false tags: