diff --git a/tasks/configure.yml b/tasks/configure.yml deleted file mode 100644 index a1cb872..0000000 --- a/tasks/configure.yml +++ /dev/null @@ -1,61 +0,0 @@ ---- - -- name: Setup PAM - template: - src: openvpn.pam.j2 - dest: /etc/pam.d/openvpn - when: openvpn_use_pam | bool - -- name: Configure users - htpasswd: - path: "{{ openvpn_etcdir }}/users" - name: "{{ item.name }}" - password: "{{ item.password }}" - crypt_scheme: des_crypt - loop: "{{ openvpn_use_pam_users }}" - -- name: Setup LDAP - template: - src: auth-ldap.conf.j2 - dest: /etc/openvpn/auth-ldap.conf - when: openvpn_use_ldap | bool - -- name: Setup simple authentication - template: - src: auth-client.sh.j2 - dest: "{{ openvpn_etcdir }}/auth-client.sh" - mode: 0o755 - when: - - openvpn_simple_auth | bool - - openvpn_simple_auth_password | bool - notify: openvpn restart - -- name: Configure server - template: - src: server.conf.j2 - dest: "{{ openvpn_etcdir }}/server.conf" - notify: openvpn restart - -- name: Ensure openvpn key dir has the right permission - file: - path: "{{ openvpn_keydir }}" - state: directory - mode: 0o700 - owner: "{{ openvpn_user }}" - -- name: Set IPv4 forwarding in the sysctl file and reload if necessary - sysctl: - name: net.ipv4.ip_forward - value: '1' - sysctl_set: true - state: present - reload: true - -- name: Set IPv6 forwarding in the sysctl file and reload if necessary - sysctl: - name: net.ipv6.conf.all.forwarding - value: '1' - sysctl_set: true - state: present - reload: true - when: openvpn_ipv6_server is defined diff --git a/tasks/system/forwarding.yml b/tasks/system/forwarding.yml index 8d1a73a..c624353 100644 --- a/tasks/system/forwarding.yml +++ b/tasks/system/forwarding.yml @@ -7,7 +7,7 @@ sysctl_set: true state: present reload: true - when: not lookup('env', 'IN_MOLECULE') | d(true, true) | bool + when: not lookup('env', 'IN_MOLECULE') | d(false, true) | bool - name: Set IPv6 forwarding in the sysctl file and reload if necessary sysctl: @@ -17,5 +17,5 @@ state: present reload: true when: - not lookup('env', 'IN_MOLECULE') | d(true, true) | bool + not lookup('env', 'IN_MOLECULE') | d(false, true) | bool and openvpn_ipv6_server is defined diff --git a/templates/server.conf.j2 b/templates/server.conf.j2 index 99a282d..ca52b05 100644 --- a/templates/server.conf.j2 +++ b/templates/server.conf.j2 @@ -14,9 +14,6 @@ port {{ openvpn_port }} # TCP or UDP server? proto {{ openvpn_proto }} -{% if openvpn_ipv6_enabled %} -proto {{ openvpn_proto }}6 -{% endif %} {% if openvpn_ipv6_enabled | bool %} proto {{ openvpn_proto }}6