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
|
- wg-install
|
||||||
when: not ansible_os_family == 'Darwin'
|
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
|
- name: Register if config/private key already exists on target host
|
||||||
stat:
|
stat:
|
||||||
path: "{{ wireguard_remote_directory }}/{{ wireguard_interface }}.conf"
|
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 %}
|
{% if hostvars[host].wireguard_allowed_ips is defined %}
|
||||||
AllowedIPs = {{hostvars[host].wireguard_allowed_ips}}
|
AllowedIPs = {{hostvars[host].wireguard_allowed_ips}}
|
||||||
{% else %}
|
{% else %}
|
||||||
AllowedIPs = {{hostvars[host].wireguard_ip}}/32
|
AllowedIPs = {{ hostvars[host].wireguard_address.split('/')[0] }}/32
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if hostvars[host].wireguard_persistent_keepalive is defined %}
|
{% if hostvars[host].wireguard_persistent_keepalive is defined %}
|
||||||
PersistentKeepalive = {{hostvars[host].wireguard_persistent_keepalive}}
|
PersistentKeepalive = {{hostvars[host].wireguard_persistent_keepalive}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue