From 65699b531dcd47a872fc5f4641e29dc6a6955b55 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 10 Feb 2016 00:03:09 +0000 Subject: [PATCH] We need to tell systemd-journald that it should sync out to persist storage otherwise it won't work until next reboot --- handlers/restart_services.yml | 2 ++ roles/base/tasks/main.yml | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/handlers/restart_services.yml b/handlers/restart_services.yml index 1de0506de4..a1f8f9a01e 100644 --- a/handlers/restart_services.yml +++ b/handlers/restart_services.yml @@ -215,3 +215,5 @@ with_items: - "{{ if_uuid.stdout_lines }}" +- name: flush journald tmpfiles to persistent store + command: pkill -USR1 systemd-journald diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index aca3c2f2be..a5da3b64ff 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -237,12 +237,14 @@ - name: enable journald persistence file: path=/var/log/journal state=directory - owner=root group=root mode=0600 + owner=root group=systemd-journal mode=0600 when: ansible_distribution_major_version|int >= 7 tags: - journald - config - base + notify: + - flush journald tmpfiles to persistent store - name: rsyslog.conf copy: src={{ item }} dest=/etc/rsyslog.conf mode=644