mirror of
https://github.com/luzifer-ansible/openvpn.git
synced 2024-12-23 02:01:16 +00:00
25 lines
497 B
YAML
25 lines
497 B
YAML
|
---
|
||
|
|
||
|
- name: Install required package
|
||
|
pacman:
|
||
|
name: openvpn
|
||
|
|
||
|
- name: Install client connection
|
||
|
template:
|
||
|
src: templates/client.conf
|
||
|
dest: /etc/openvpn/client/client.conf
|
||
|
register: openvpn_config
|
||
|
|
||
|
- name: Enable autostart for OpenVPN connection "client"
|
||
|
systemd:
|
||
|
name: openvpn-client@client.service
|
||
|
enabled: yes
|
||
|
|
||
|
- name: Restart OpenVPN connection when required
|
||
|
systemd:
|
||
|
name: openvpn-client@client.service
|
||
|
state: restarted
|
||
|
when: openvpn_config.changed
|
||
|
|
||
|
...
|