ansible-pilote/tasks/openvpn.yml
Julien Riou 38fef42aa6
style: Add ansible-lint
Signed-off-by: Julien Riou <julien@riou.xyz>
2024-05-10 13:32:56 +02:00

40 lines
900 B
YAML

---
- name: Install OpenVPN
ansible.builtin.apt:
name: openvpn
- name: Deploy OpenVPN configuration
ansible.builtin.template:
src: openvpn/client.conf.j2
dest: /etc/openvpn/client.conf
mode: '0644'
- name: Deploy OpenVPN CA cert
ansible.builtin.copy:
content: "{{ openvpn_ca }}"
dest: /etc/openvpn/ca.crt
mode: '0644'
- name: Deploy OpenVPN TLS auth
ansible.builtin.copy:
content: "{{ openvpn_ta }}"
dest: /etc/openvpn/ta.key
mode: '0600'
- name: Deploy OpenVPN client cert
ansible.builtin.copy:
content: "{{ openvpn_cert }}"
dest: /etc/openvpn/client.crt
mode: '0644'
- name: Deploy OpenVPN client key
ansible.builtin.copy:
content: "{{ openvpn_key }}"
dest: /etc/openvpn/client.key
mode: '0600'
- name: Start OpenVPN
ansible.builtin.systemd:
name: "openvpn@client.service"
state: started
enabled: true