Przeglądaj źródła

interface:config is not required if enable: False

tags/v1.0
Maximilian Eschenbacher 6 lat temu
rodzic
commit
c838984da2
1 zmienionych plików z 3 dodań i 1 usunięć
  1. +3
    -1
      wireguard/init.sls

+ 3
- 1
wireguard/init.sls Wyświetl plik

{%- 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 %}

Ładowanie…
Anuluj
Zapisz