Move wireguard_ip template code to template where it belongs
Instead of redundant set_fact task.
This commit is contained in:
parent
3362f1c2fc
commit
739c9de73e
2 changed files with 1 additions and 5 deletions
|
@ -24,10 +24,6 @@
|
|||
- wg-install
|
||||
when: not ansible_os_family == 'Darwin'
|
||||
|
||||
- name: Set WireGuard IP (without mask)
|
||||
set_fact:
|
||||
wireguard_ip: "{{ wireguard_address.split('/')[0] }}"
|
||||
|
||||
- name: Register if config/private key already exists on target host
|
||||
stat:
|
||||
path: "{{ wireguard_remote_directory }}/{{ wireguard_interface }}.conf"
|
||||
|
|
|
@ -50,7 +50,7 @@ PublicKey = {{hostvars[host].wireguard__fact_public_key}}
|
|||
{% if hostvars[host].wireguard_allowed_ips is defined %}
|
||||
AllowedIPs = {{hostvars[host].wireguard_allowed_ips}}
|
||||
{% else %}
|
||||
AllowedIPs = {{hostvars[host].wireguard_ip}}/32
|
||||
AllowedIPs = {{ hostvars[host].wireguard_address.split('/')[0] }}/32
|
||||
{% endif %}
|
||||
{% if hostvars[host].wireguard_persistent_keepalive is defined %}
|
||||
PersistentKeepalive = {{hostvars[host].wireguard_persistent_keepalive}}
|
||||
|
|
Loading…
Reference in a new issue