|
|
|
|
|
|
|
|
pkg.installed: |
|
|
pkg.installed: |
|
|
- name: {{ wireguard.package }} |
|
|
- name: {{ wireguard.package }} |
|
|
|
|
|
|
|
|
{% for name, values in salt['pillar.get']('wireguard:interfaces', {}).items() %} |
|
|
|
|
|
wireguard_{{ name }}: |
|
|
|
|
|
|
|
|
{% for interface, values in salt['pillar.get']('wireguard:interfaces', {}).items() %} |
|
|
|
|
|
wireguard_{{ interface }}: |
|
|
wg.present: |
|
|
wg.present: |
|
|
- name: {{ name }} |
|
|
|
|
|
|
|
|
- name: {{ interface }} |
|
|
{% for k, v in values.items() %} |
|
|
{% for k, v in values.items() %} |
|
|
|
|
|
{% if k in ['listen_port', 'fwmark', 'private_key', 'preshared_key'] %} |
|
|
- {{k}}: {{v}} |
|
|
- {{k}}: {{v}} |
|
|
{% endfor %} |
|
|
|
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
{% endif %} |
|
|
|
|
|
{% endfor %} {# values.items() #} |
|
|
|
|
|
|
|
|
{% for interface, peerlist in salt['pillar.get']('wireguard:peers', {}).items() %} |
|
|
|
|
|
{% for peer in peerlist %} |
|
|
|
|
|
|
|
|
{% for peer in values.get('peers', {}) %} |
|
|
wireguard_{{ interface }}_peer_{{ peer.get('peer') }}: |
|
|
wireguard_{{ interface }}_peer_{{ peer.get('peer') }}: |
|
|
wg.peer_present: |
|
|
wg.peer_present: |
|
|
- interface: {{ interface }} |
|
|
- interface: {{ interface }} |
|
|
|
|
|
|
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% for interface in salt['pillar.get']('wireguard:set_forward_interfaces', []) %} |
|
|
{% for interface in salt['pillar.get']('wireguard:set_forward_interfaces', []) %} |
|
|
net.ipv4.conf.{{interface}}.forwarding: |
|
|
net.ipv4.conf.{{interface}}.forwarding: |
|
|
sysctl.present: |
|
|
sysctl.present: |