Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocky support and other proposals #170

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Seb44800
Copy link

Hi all,
It is my first contribution. So be cool :-)

Sebastien Coche added 9 commits December 23, 2021 14:33

Ubuntu precise has a [weird bug](https://bugs.launchpad.net/ubuntu/+source/iptables-persistent/+bug/1002078) that might make the iptables-persistent install fail. There is a [workaround](https://forum.linode.com/viewtopic.php?p=58233#p58233).

# Support Notes/Expectations
I personally use this role to manage OpenVPN on CentOS 8. I try to keep the role on that platform fully functional with the default config.
Please recognise that I am a single person, and I have a full time job and other commitments.
Please recognise that I am a single person, and I have a full time job and other commitments. This initial role was extended to support Rocky Linux 8.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to change this.

| openvpn_ca_key | dict | | `unset` | Contain "crt" and "key". If not set, CA cert and key will be automatically generated on the target system. |
| openvpn_cipher | string | | AES-256-CBC | Set `cipher` option for server and client. |
| openvpn_cipher | string | | AES-256-GCM | Set `cipher` option for server and client. AES-256-GCM is more secure than AES-256-CBC. So it is set by default. |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on changing the default to GCM, but you can drop the comment change.

@@ -14,13 +14,13 @@ openvpn_redirect_gateway: true
openvpn_resolv_retry: 5
openvpn_server_hostname: "{{ inventory_hostname }}"
openvpn_server_netmask: 255.255.255.0
openvpn_server_network: 10.9.0.0
openvpn_server_network: 192.168.254.0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this?

- name: Fail on no firewall detected
fail:
msg: "No firewall detected, install one before proceeding (firewalld||ufw||iptables)"
- name: Install firewalld if no firewall detected
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this - firewall has impact on other parts of the system beyond OpenVPN, it's more appropriate to have this as a task in the ansible file that includes the playbook.

when: firewalld.rc != 0 and ufw.rc != 0 and iptables.rc != 0

- name: Check for firewalld
shell: command -v firewall-cmd
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just an fyi - which is used earlier because it's an external binary, it doesn't require shell

{% endif %}
dev tun

{% if ca_chain is defined %}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine.

@@ -7,11 +7,16 @@ port {{ openvpn_port }}
{% if openvpn_dualstack %}
proto {{ openvpn_proto }}6
{% else %}
proto {{ openvpn_proto }}
proto {{ openvpn_proto }}4
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add 4 here? Set openvpn_proto to 4 instead?

@@ -110,6 +115,8 @@ management-client-user {{ openvpn_management_client_user }}
### LDAP AUTH ###
{% if ansible_os_family == 'Debian' %}
plugin /usr/lib/openvpn/openvpn-auth-ldap.so "{{ openvpn_base_dir }}/auth/ldap.conf"
{% elif ansible_machine == "x86_64" and ansible_distribution == "Rocky" %}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a Rocky specific path?

@@ -118,7 +125,7 @@ plugin /usr/lib/openvpn/plugin/lib/openvpn-auth-ldap.so "{{ openvpn_base_dir }}/
{% if ldap.verify_client_cert is defined %}
verify-client-cert {{ ldap.verify_client_cert }}
{% else %}
client-cert-not-required
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you set ldap.verify_client_cert to require?

@@ -5,7 +5,7 @@ openvpn_client_register_dns: true
openvpn_client_to_client: false
openvpn_custom_dns: []
openvpn_dns_servers: []
openvpn_dualstack: true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants