updated openvpn_server state
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Paul 2022-12-09 23:47:57 +01:00
parent dd0756186f
commit 25ed38ead8
2 changed files with 20 additions and 6 deletions

View File

@ -1,5 +1,6 @@
--- ---
{%- from "openvpn_server/map.jinja" import openvpn_server with context %} {%- from "openvpn_server/map.jinja" import openvpn_server with context %}
{%- from "openvpn_client/map.jinja" import openvpn_client with context %}
{%- for key, instance in openvpn_server.config.items() %} {%- for key, instance in openvpn_server.config.items() %}
openvpn-server-{{ key }}-config: openvpn-server-{{ key }}-config:
file.managed: file.managed:
@ -24,4 +25,13 @@ openvpn-server-{{ key }}-config:
dns: {{ instance.dns }} dns: {{ instance.dns }}
- watch_in: - watch_in:
- service: openvpn-server-{{ key }}-service - service: openvpn-server-{{ key }}-service
{% for user in openvpn_client.config[key].remote_hosts -%}
openvpn-server-user-{{ user.name }}:
user.present:
- name: {{ user.name }}
- password: {{ user.password }}
- hash_password: true
- shell: /sbin/nologin
{% endfor -%}
{%- endfor %} {%- endfor %}

View File

@ -1,8 +1,12 @@
{%- import_yaml "openvpn_server/defaults.yaml" as defaults %} {%- import_yaml "openvpn_server/defaults.yaml" as server %}
{%- import_yaml "openvpn_client/defaults.yaml" as client %}
{%- set openvpn_server = salt['pillar.get']( {%- set openvpn_server = salt['pillar.get'](
'openvpn_server', 'openvpn_server',
default=defaults.openvpn_server, default=server.openvpn_server,
merge=True merge=True) -%}
)
-%} {%- set openvpn_client = salt['pillar.get'](
'openvpn_client',
default=client.openvpn_client,
merge=True) -%}