This commit is contained in:
parent
dd0756186f
commit
25ed38ead8
@ -1,5 +1,6 @@
|
||||
---
|
||||
{%- 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() %}
|
||||
openvpn-server-{{ key }}-config:
|
||||
file.managed:
|
||||
@ -24,4 +25,13 @@ openvpn-server-{{ key }}-config:
|
||||
dns: {{ instance.dns }}
|
||||
- watch_in:
|
||||
- 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 %}
|
||||
|
@ -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'](
|
||||
'openvpn_server',
|
||||
default=defaults.openvpn_server,
|
||||
merge=True
|
||||
)
|
||||
-%}
|
||||
default=server.openvpn_server,
|
||||
merge=True) -%}
|
||||
|
||||
{%- set openvpn_client = salt['pillar.get'](
|
||||
'openvpn_client',
|
||||
default=client.openvpn_client,
|
||||
merge=True) -%}
|
Loading…
Reference in New Issue
Block a user