openvpn/tasks/install.yml

43 lines
947 B
YAML
Raw Normal View History

2020-08-17 11:48:37 +02:00
---
- name: 'openvpn | update APT Cache'
apt:
update_cache: yes
cache_valid_time: 3600
tags: ['openvpn', 'openvpn_install']
- name: 'openvpn | install packages'
apt:
name:
- openvpn
- openssl
- easy-rsa
state: present
2020-10-28 17:16:40 +01:00
register: is_installed
2020-08-17 11:48:37 +02:00
tags: ['openvpn', 'openvpn_install']
- name: 'openvpn | create directories'
file:
path: /etc/openvpn/{{ ansible_hostname }}/keys
state: directory
mode: '0755'
2020-10-28 17:16:40 +01:00
when: is_installed
2020-08-17 11:48:37 +02:00
tags: ['openvpn', 'openvpn_install']
- name: 'openvpn | copy easy-rsa'
copy:
src: /usr/share/easy-rsa
dest: /etc/openvpn/{{ ansible_hostname }}
owner: root
group: root
2020-10-28 17:16:40 +01:00
when: is_installed
2020-08-17 11:48:37 +02:00
tags: ['openvpn', 'openvpn_install']
- name: 'openvpn | chmod +x easyrsa'
file:
path: /etc/openvpn/{{ ansible_hostname }}/easy-rsa/easyrsa
owner: root
group: root
mode: 0755
2020-10-28 17:16:40 +01:00
when: is_installed
2020-08-17 11:48:37 +02:00
tags: ['openvpn', 'openvpn_install']