use boolean as variable type for wg_syncconf
This commit is contained in:
parent
dc56b0d39e
commit
12c30b5b6a
|
@ -3,7 +3,7 @@
|
|||
service:
|
||||
name: "wg-quick@{{ wireguard_interface }}"
|
||||
state: restarted
|
||||
when: wg_syncconf == "false"
|
||||
when: not wg_syncconf
|
||||
listen: "reconfigure wireguard"
|
||||
|
||||
- name: syncconf wireguard
|
||||
|
@ -13,5 +13,5 @@
|
|||
exit 0
|
||||
args:
|
||||
executable: "/bin/bash"
|
||||
when: wg_syncconf == "true"
|
||||
when: wg_syncconf
|
||||
listen: "reconfigure wireguard"
|
||||
|
|
|
@ -43,15 +43,19 @@
|
|||
command: "wg --help"
|
||||
register: wg_subcommands
|
||||
|
||||
- name: Set default value for wg_syncconf variable
|
||||
- name: Set default value for wg_syncconf variable (assume wg syncconf subcommand not available)
|
||||
set_fact:
|
||||
wg_syncconf: "false"
|
||||
wg_syncconf: false
|
||||
|
||||
- name: Check if wg syncconf subcommand is available
|
||||
set_fact:
|
||||
wg_syncconf: "true"
|
||||
wg_syncconf: true
|
||||
when: wg_subcommands.stdout | regex_search('syncconf:')
|
||||
|
||||
- name: Show syncconf subcommand status
|
||||
debug:
|
||||
var: wg_syncconf
|
||||
|
||||
- block:
|
||||
- name: Generate WireGuard private key
|
||||
shell: "wg genkey"
|
||||
|
|
Reference in a new issue