From 7a1af464b124b2316aa473524cefa709954f4a8e Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Sun, 13 Sep 2020 22:49:21 +0200 Subject: [PATCH] Move condition code into Jinja instead of having two set_fact tasks --- tasks/main.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 2dfa8b8..8183456 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -41,14 +41,9 @@ register: wg_subcommands changed_when: false -- name: Set default value for wg_syncconf variable (assume wg syncconf subcommand not available) - set_fact: - wg_syncconf: false - - name: Check if wg syncconf subcommand is available set_fact: - wg_syncconf: true - when: wg_subcommands.stdout | regex_search('syncconf:') + wg_syncconf: "{{ 'syncconf:' in wg_subcommands.stdout }}" - name: Show syncconf subcommand status debug: