|
|
|
|
|
|
|
|
{%- for interface in salt['pillar.get']('wireguard', {}).keys() %} |
|
|
{%- for interface in salt['pillar.get']('wireguard', {}).keys() %} |
|
|
|
|
|
|
|
|
|
|
|
{% if salt['pillar.get']('wireguard:' ~ interface ~ ':enable', True) %} |
|
|
wireguard_interface_{{interface}}: |
|
|
wireguard_interface_{{interface}}: |
|
|
file.managed: |
|
|
file.managed: |
|
|
- name: /etc/wireguard/{{interface}}.conf |
|
|
- name: /etc/wireguard/{{interface}}.conf |
|
|
- contents_pillar: wireguard:{{interface}}:config |
|
|
- contents_pillar: wireguard:{{interface}}:config |
|
|
- mode: 640 |
|
|
- mode: 640 |
|
|
|
|
|
|
|
|
{% if salt['pillar.get']('wireguard:' ~ interface ~ ':enable', True) %} |
|
|
|
|
|
restart wg-quick@{{interface}}: |
|
|
restart wg-quick@{{interface}}: |
|
|
service.running: |
|
|
service.running: |
|
|
- name: wg-quick@{{interface}} |
|
|
- name: wg-quick@{{interface}} |
|
|
|
|
|
|
|
|
- name: wg-quick@{{interface}} |
|
|
- name: wg-quick@{{interface}} |
|
|
- enable: False |
|
|
- enable: False |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
|
|
|
|
|
|
{%- endfor %} |
|
|
{%- endfor %} |