vm-ansible/roles/openvpn/tasks/main.yaml

33 lines
638 B
YAML
Raw Normal View History

2022-04-14 16:10:43 +02:00
---
- name: "Install openvpn-server via apt"
apt:
update_cache: yes
state: present
name:
- openvpn-server
2022-04-14 21:41:04 +02:00
- name : "Enable ipv4 forwarding via sysctl"
ansible.posix.sysctl:
name: net.ipv4.ip_forward
value: '1'
sysctl_set: yes
state: present
reload: yes
2022-04-14 16:10:43 +02:00
- name: Upload openvpn config to server
ansible.posix.synchronize:
src: openvpn-config
dest: /etc/openvpn/server
- name: Enable and restart openvpn daemon
service:
name: openvpn
state: restarted
enabled: yes
- name: Allow openvpn port via ufw
community.general.ufw:
rule: allow
port: "1194"
proto: udp