- openvpn.log
- connect.log
- disconnect.log
- file:
- state: touch
- path: /var/log/openvpn/{{ item }}
+ copy:
+ content: ""
+ force: no
+ dest: /var/log/openvpn/{{ item }}
owner: openvpn
group: openvpn
mode: "0644"
+- name: rotate user logs
+ when: vpn_mode == 'user-server'
+ copy:
+ src: openvpn-user.logrotate
+ dest: /etc/logrotate.d/openvpn-user
+ owner: root
+ group: root
+ mode: "0644"
+
+- name: rotate vpc logs
+ when: vpn_mode == 'vpc-server'
+ copy:
+ src: openvpn-vpc.logrotate
+ dest: /etc/logrotate.d/openvpn-vpc
+ owner: root
+ group: root
+ mode: "0644"
+
- name: install scripts
when: vpn_mode == 'user-server'
with_items:
status-version 3
status /var/log/openvpn/status.log
client-connect /etc/openvpn/scripts/event-log.sh
+client-disconnect /etc/openvpn/scripts/event-log.sh
tmp-dir /dev/shm
{% if phase|default() == 'prod' %}