paulbsd-salt/states/openvpn_client/vpn.conf.j2

37 lines
840 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
2020-07-10 01:56:49 +02:00
{%- from "openvpn_client/map.jinja" import openvpn_client with context %}
2020-07-10 00:58:55 +02:00
<ca>
2020-07-10 01:56:49 +02:00
{{ openvpn_client.config.vpn.ca }}
2020-07-10 00:58:55 +02:00
</ca>
<cert>
2020-07-10 01:56:49 +02:00
{{ openvpn_client.config.vpn.cert }}
2020-07-10 00:58:55 +02:00
</cert>
<key>
2020-07-10 01:56:49 +02:00
{{ openvpn_client.config.vpn.key }}
2020-07-10 00:58:55 +02:00
</key>
client
2020-07-10 01:56:49 +02:00
remote {{ openvpn_client.config.vpn.global_endpoint_host }} {{ openvpn_client.config.vpn.global_endpoint_port }}
proto {{ openvpn_client.config.vpn.global_endpoint_proto }}
2020-07-10 00:58:55 +02:00
dev tun
topology subnet
keepalive 10 120
nobind
persist-key
persist-tun
compress lzo
fast-io
2022-10-01 20:10:46 +02:00
{% for k,v in salt['network.interfaces']().items() -%}
{%- if k.startswith('en') or k.startswith('eth') %}
2022-12-09 21:56:54 +01:00
{%- for net in salt['network.subnets'](k) %}
2022-10-01 20:10:46 +02:00
pull-filter ignore "route {{ net.split("/")[0] }}"
{%- endfor %}
{%- endif %}
{%- endfor %}
2021-08-19 21:15:24 +02:00
auth-user-pass private/pass