ansible-torrent-server/tasks/vpn.yml

30 lines
605 B
YAML
Raw Normal View History

2021-02-23 18:54:00 +01:00
---
- name: Ensure openvpn is installed
apt:
name: openvpn
state: present
- name: Ensure config files are present
copy:
src: vpn/
dest: /etc/openvpn/client/
2021-03-03 19:09:17 +01:00
mode: 0600
2021-02-23 18:54:00 +01:00
owner: root
group: root
notify: Restart openvpn
- name: Ensure the passfile is present
template:
src: passfile.j2
2021-03-03 19:09:17 +01:00
dest: /etc/openvpn/client/login.txt
2021-02-23 18:54:00 +01:00
mode: 0600
owner: root
group: root
notify: Restart openvpn
- name: Ensure openvpn is enabled and started
systemd:
name: "openvpn-client@{{ torrent_server.openvpn.outserver }}.service"
state: started
enabled: yes