Skip to content

Commit dd41460

Browse files
authored
Openvpn client fqdn pr 2.x (#1506)
* Supporting a fixed PHP version with a fixed port number. * Accidently re-added the old VPN role - re-deleting! * Handling allowing client config template for ovpn to have an FQDN. * Let's not assume port 1194 for ovpn. * Tweaking FQDN handling in ovpn.
1 parent 8de80ab commit dd41460

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

docs/roles/debian/openvpn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ At the moment we do not support headless customisation of encryption settings. T
2020
---
2121
openvpn:
2222
script_install_path: "/home/{{ user_provision.username }}"
23-
fqdn: "" # fully qualified domain name of VPN server for use in client config, uses IP address if empty
23+
fqdn: "" # fully qualified domain name of VPN server for use in client config, uses IP address if empty - only works with port_choice: "1"
2424
auto_install: true
2525
# post install server config tweaks
2626
ipv4_settings: "" # defaults to `10.8.0.0 255.255.255.0` - example, to use 192.168.140.0/24 set "192.168.140.0 255.255.255.0"

roles/debian/openvpn/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ At the moment we do not support headless customisation of encryption settings. T
2020
---
2121
openvpn:
2222
script_install_path: "/home/{{ user_provision.username }}"
23-
fqdn: "" # fully qualified domain name of VPN server for use in client config, uses IP address if empty
23+
fqdn: "" # fully qualified domain name of VPN server for use in client config, uses IP address if empty - only works with port_choice: "1"
2424
auto_install: true
2525
# post install server config tweaks
2626
ipv4_settings: "" # defaults to `10.8.0.0 255.255.255.0` - example, to use 192.168.140.0/24 set "192.168.140.0 255.255.255.0"

roles/debian/openvpn/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
openvpn:
33
script_install_path: "/home/{{ user_provision.username }}"
4-
fqdn: "" # fully qualified domain name of VPN server for use in client config, uses IP address if empty
4+
fqdn: "" # fully qualified domain name of VPN server for use in client config, uses IP address if empty - only works with port_choice: "1"
55
auto_install: true
66
# post install server config tweaks
77
ipv4_settings: "" # defaults to `10.8.0.0 255.255.255.0` - example, to use 192.168.140.0/24 set "192.168.140.0 255.255.255.0"

roles/debian/openvpn/tasks/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,12 @@
168168
mode: '0644'
169169
when: openvpn.tls_cipher | length > 0
170170

171+
# Only works when openvpn.port_choice == '1' because otherwise port will not be 1194 and regexp will not match
171172
- name: Use FQDN as OpenVPN server remote in client config.
172173
ansible.builtin.lineinfile:
173174
path: /etc/openvpn/client-template.txt
174-
regexp: '^remote (.*)'
175-
line: "remote {{ openvpn.fqdn }}"
175+
regexp: '^remote (.*) 1194'
176+
line: "remote {{ openvpn.fqdn }} 1194"
176177
owner: root
177178
group: root
178179
mode: '0644'

0 commit comments

Comments
 (0)