updated openvpn_client
This commit is contained in:
parent
eaa6b99c5e
commit
51a0f7025c
@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
{%- from "openvpn_client/map.jinja" import openvpn with context %}
|
{%- from "openvpn_client/map.jinja" import openvpn_client with context %}
|
||||||
openvpn-client-main-config:
|
openvpn-client-main-config:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ openvpn.config_dir }}/vpn.conf
|
- name: {{ openvpn_client.config_dir }}/vpn.conf
|
||||||
- source: salt://openvpn_client/vpn.conf.j2
|
- source: salt://openvpn_client/vpn.conf.j2
|
||||||
- user: root
|
- user: root
|
||||||
- group: root
|
- group: root
|
||||||
@ -13,7 +13,7 @@ openvpn-client-main-config:
|
|||||||
|
|
||||||
openvpn-client-private-dir:
|
openvpn-client-private-dir:
|
||||||
file.directory:
|
file.directory:
|
||||||
- name: {{ openvpn.config_dir }}/vpn
|
- name: {{ openvpn_client.config_dir }}/private
|
||||||
- user: root
|
- user: root
|
||||||
- group: root
|
- group: root
|
||||||
- mode: 0700
|
- mode: 0700
|
||||||
@ -22,7 +22,7 @@ openvpn-client-private-dir:
|
|||||||
|
|
||||||
openvpn-client-private-access:
|
openvpn-client-private-access:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ openvpn.config_dir }}/vpn/pass
|
- name: {{ openvpn_client.config_dir }}/private/pass
|
||||||
- source: salt://openvpn_client/pass.j2
|
- source: salt://openvpn_client/pass.j2
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- user: root
|
- user: root
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
---
|
---
|
||||||
openvpn:
|
openvpn_client:
|
||||||
config_dir: /etc/openvpn
|
config_dir: /etc/openvpn
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{%- import_yaml "openvpn_client/defaults.yaml" as default_settings -%}
|
{%- import_yaml "openvpn_client/defaults.yaml" as default_settings -%}
|
||||||
|
|
||||||
{%- set defaults = salt['grains.filter_by'](default_settings, default='openvpn') -%}
|
{%- set defaults = salt['grains.filter_by'](default_settings, default='openvpn_client') -%}
|
||||||
|
|
||||||
{%- set openvpn = salt['pillar.get']('openvpn', default=defaults, merge=True) -%}
|
{%- set openvpn_client = salt['pillar.get']('openvpn_client', default=defaults, merge=True) -%}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{%- from "openvpn_client/map.jinja" import openvpn with context -%}
|
{%- from "openvpn_client/map.jinja" import openvpn_client with context -%}
|
||||||
{%- for client in openvpn.config.vpn.remote_hosts -%}
|
{%- for client in openvpn_client.config.vpn.remote_hosts -%}
|
||||||
{%- if client.name == salt['grains.get']('host') -%}
|
{%- if client.name == salt['grains.get']('host') -%}
|
||||||
{{ client.name }}
|
{{ client.name }}
|
||||||
{{ client.password }}
|
{{ client.password }}
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
|
## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
|
||||||
{%- from "openvpn_client/map.jinja" import openvpn with context %}
|
{%- from "openvpn_client/map.jinja" import openvpn_client with context %}
|
||||||
<ca>
|
<ca>
|
||||||
{{ openvpn.config.vpn.ca }}
|
{{ openvpn_client.config.vpn.ca }}
|
||||||
</ca>
|
</ca>
|
||||||
<cert>
|
<cert>
|
||||||
{{ openvpn.config.vpn.cert }}
|
{{ openvpn_client.config.vpn.cert }}
|
||||||
</cert>
|
</cert>
|
||||||
<key>
|
<key>
|
||||||
{{ openvpn.config.vpn.key }}
|
{{ openvpn_client.config.vpn.key }}
|
||||||
</key>
|
</key>
|
||||||
client
|
client
|
||||||
remote {{ openvpn.config.vpn.global_endpoint_host }} {{ openvpn.config.vpn.global_endpoint_port }}
|
remote {{ openvpn_client.config.vpn.global_endpoint_host }} {{ openvpn_client.config.vpn.global_endpoint_port }}
|
||||||
proto {{ openvpn.config.vpn.global_endpoint_proto }}
|
proto {{ openvpn_client.config.vpn.global_endpoint_proto }}
|
||||||
dev tun
|
dev tun
|
||||||
|
|
||||||
topology subnet
|
topology subnet
|
||||||
@ -26,4 +26,4 @@ persist-tun
|
|||||||
compress lzo
|
compress lzo
|
||||||
fast-io
|
fast-io
|
||||||
|
|
||||||
auth-user-pass vpn/pass
|
auth-user-pass private/pass
|
||||||
|
Loading…
Reference in New Issue
Block a user