Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/roles/debian/openvpn.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ At the moment we do not support headless customisation of encryption settings. T
---
openvpn:
script_install_path: "/home/{{ user_provision.username }}"
fqdn: "" # fully qualified domain name of VPN server for use in client config, uses IP address if empty
fqdn: "" # fully qualified domain name of VPN server for use in client config, uses IP address if empty - only works with port_choice: "1"
auto_install: true
# post install server config tweaks
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"
Expand Down
2 changes: 1 addition & 1 deletion roles/debian/openvpn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ At the moment we do not support headless customisation of encryption settings. T
---
openvpn:
script_install_path: "/home/{{ user_provision.username }}"
fqdn: "" # fully qualified domain name of VPN server for use in client config, uses IP address if empty
fqdn: "" # fully qualified domain name of VPN server for use in client config, uses IP address if empty - only works with port_choice: "1"
auto_install: true
# post install server config tweaks
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"
Expand Down
2 changes: 1 addition & 1 deletion roles/debian/openvpn/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
openvpn:
script_install_path: "/home/{{ user_provision.username }}"
fqdn: "" # fully qualified domain name of VPN server for use in client config, uses IP address if empty
fqdn: "" # fully qualified domain name of VPN server for use in client config, uses IP address if empty - only works with port_choice: "1"
auto_install: true
# post install server config tweaks
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"
Expand Down
5 changes: 3 additions & 2 deletions roles/debian/openvpn/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,12 @@
mode: '0644'
when: openvpn.tls_cipher | length > 0

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