mirror of
https://github.com/luzifer-ansible/openvpn.git
synced 2024-11-08 13:50:01 +00:00
26 lines
501 B
YAML
26 lines
501 B
YAML
|
---
|
||
|
|
||
|
- name: Install required package
|
||
|
apt:
|
||
|
name: openvpn
|
||
|
cache_valid_time: 86400
|
||
|
|
||
|
- name: Install client connection
|
||
|
template:
|
||
|
src: templates/client.conf
|
||
|
dest: /etc/openvpn/client.conf
|
||
|
register: openvpn_config
|
||
|
|
||
|
- name: Enable autostart for OpenVPN connection "client"
|
||
|
systemd:
|
||
|
name: openvpn@client.service
|
||
|
enabled: yes
|
||
|
|
||
|
- name: Restart OpenVPN connection when required
|
||
|
systemd:
|
||
|
name: openvpn@client.service
|
||
|
state: restarted
|
||
|
when: openvpn_config.changed
|
||
|
|
||
|
...
|