library/roles/openvpn: support pushing dhcp properties to the clients.

infrastructure-services/group_vars/vpn/vpn.yml: Push the internal DNS IP address.
This commit is contained in:
Andrea Dell'Amico 2016-06-15 19:31:27 +02:00
parent 037b16bd53
commit 76b8a3af4f
2 changed files with 13 additions and 0 deletions

View File

@ -24,6 +24,9 @@ openvpn_server_net: '192.168.254.0 255.255.255.0'
openvpn_push_routes:
- '192.168.253.0 255.255.255.0'
#openvpn_push_settings:
# - "dhcp-option DNS 10.66.0.4"
openvpn_tls_server: True
openvpn_dh: /etc/openvpn/dh2048.pem
openvpn_tls_auth: '/etc/openvpn/ta.key 0'

View File

@ -7,6 +7,16 @@ ifconfig-pool-persist ipp/ipp.txt
push "route {{ route }}"
{% endfor %}
{% for route in openvpn_push_routes %}
push "route {{ route }}"
{% endfor %}
{% if openvpn_push_settings is defined %}
{% for dhcp_opt in openvpn_push_settings %}
push "{{ dhcp_opt }}"
{% endfor %}
{% endif %}
port {{ openvpn_port }}
proto {{ openvpn_protocol }}