create syslogd role and enable it on openbsd

This commit is contained in:
Timo Makinen 2019-05-29 00:34:44 +03:00
parent 13f0332fa1
commit c1db2dc402
3 changed files with 33 additions and 0 deletions

View file

@ -54,5 +54,6 @@
name: "{{ role }}"
with_items:
- pf
- syslogd
loop_control:
loop_var: role

View file

@ -0,0 +1,5 @@
---
- name: restart syslogd
service:
name: syslogd
state: restarted

View file

@ -0,0 +1,27 @@
---
- name: verify that all.log exists
stat:
path: /var/log/all.log
register: result
- name: create dummy all.log file
file:
path: /var/log/all.log
state: touch
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
when: not result.stat.exists
- name: enable all.log
lineinfile:
path: /etc/syslog.conf
line: "*.* /var/log/all.log"
notify: restart syslogd
- name: enable all.log rotation
lineinfile:
path: /etc/newsyslog.conf
regexp: "^/var/log/all.log.*"
line: "/var/log/all.log root:{{ ansible_wheel }} 640 7 * $D0 Z"