diff --git a/roles/rsyslog/tasks/archival.yaml b/roles/rsyslog/tasks/archival.yaml index d786bbf..c733dc3 100644 --- a/roles/rsyslog/tasks/archival.yaml +++ b/roles/rsyslog/tasks/archival.yaml @@ -4,6 +4,20 @@ rsyslog_default_rules_state: absent when: rsyslog_archival_format_enabled +- name: configure systemd tmpfiles.d + template: + src: tmpfiles_d-rsyslog.conf + dest: /etc/tmpfiles.d/00rsyslog.conf + owner: root + group: root + mode: 0644 + when: rsyslog_archival_format_enabled + +- name: manage systemd tmpfiles.d override + file: + path: /etc/tmpfiles.d/00rsyslog.conf + state: "{{ rsyslog_archival_format_enabled | ternary('file', 'absent') }}" + - name: find default log files find: path: /var/log diff --git a/roles/rsyslog/templates/tmpfiles_d-rsyslog.conf b/roles/rsyslog/templates/tmpfiles_d-rsyslog.conf new file mode 100644 index 0000000..1fc1809 --- /dev/null +++ b/roles/rsyslog/templates/tmpfiles_d-rsyslog.conf @@ -0,0 +1,3 @@ +# {{ ansible_managed }} + +d /var/log/syslog {{ rsyslog_dir_create_mode }} {{ rsyslog_dir_owner }} {{ rsyslog_dir_group }} -