## Bu dosya ansible tarafindan yonetilmektedir!
## Burada yapilan degisikliklerin uzerine yazilir!!
{{ ansible_managed }}

ca {{ openvpn['common_conf']['ca'] }}
cert {{ openvpn['common_conf']['cert'] }}
key {{ openvpn['common_conf']['key'] }}
dh {{ openvpn['common_conf']['dh'] }} 

tls-version-min {{ openvpn['common_conf']['tls-version-min'] }}
ifconfig-pool-persist ipp.txt
dev {{ openvpn['common_conf']['dev'] }}

{% for key,value in openvpn_servers.iteritems() %}

{% if value.fqdn == ansible_fqdn %}
port {{ value.port }}
proto {{ value.proto }}
server {{ value.server }}

push "redirect-gateway def1 bypass-dhcp"
{% for dnskey,dnsvalue in value.dns_servers.iteritems() %}
push "dhcp-option DNS {{ dnsvalue.ip }}"
{% endfor %}

{% if value.auth != "noldap" %}
auth-nocache
plugin /usr/lib/openvpn/openvpn-auth-ldap.so "/etc/openvpn/auth-ldap.conf"
client-cert-not-required
{% endif %}

{% endif %}
{% endfor %}

user {{ openvpn['common_conf']['user'] }}
group {{ openvpn['common_conf']['group'] }}
status {{ openvpn['common_conf']['status'] }}
log {{ openvpn['common_conf']['log'] }}
verb {{ openvpn['common_conf']['verb'] }}

comp-lzo
keepalive 10 120
persist-key
persist-tun
duplicate-cn

tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384
auth SHA512
cipher AES-256-CBC

