diff options
Diffstat (limited to 'ansible')
-rw-r--r-- | ansible/roles/trygvis-base/defaults/main.yml | 1 | ||||
-rw-r--r-- | ansible/roles/trygvis-base/handlers/main.yml | 4 | ||||
-rw-r--r-- | ansible/roles/trygvis-base/tasks/main.yml | 23 |
3 files changed, 26 insertions, 2 deletions
diff --git a/ansible/roles/trygvis-base/defaults/main.yml b/ansible/roles/trygvis-base/defaults/main.yml index 8244bbf..e45da41 100644 --- a/ansible/roles/trygvis-base/defaults/main.yml +++ b/ansible/roles/trygvis-base/defaults/main.yml @@ -1,6 +1,7 @@ trygvis_base__etc_localtime: yes trygvis_base__remove_root_authorized_keys: yes trygvis_base__fix_aliases: yes +trygvis_base__journald: yes # These mostly applies to LXC hosts trygvis_base__fix_hosts: no diff --git a/ansible/roles/trygvis-base/handlers/main.yml b/ansible/roles/trygvis-base/handlers/main.yml index f06ad24..cbba9a3 100644 --- a/ansible/roles/trygvis-base/handlers/main.yml +++ b/ansible/roles/trygvis-base/handlers/main.yml @@ -5,3 +5,7 @@ - name: postalias /etc/aliases become: yes shell: "[ ! -x /usr/sbin/postalias ] || /usr/sbin/postalias /etc/aliases" + +- name: reload journalctl + become: yes + command: /usr/bin/pkill -f -USR1 systemd-journald diff --git a/ansible/roles/trygvis-base/tasks/main.yml b/ansible/roles/trygvis-base/tasks/main.yml index d753056..0fc5782 100644 --- a/ansible/roles/trygvis-base/tasks/main.yml +++ b/ansible/roles/trygvis-base/tasks/main.yml @@ -47,11 +47,30 @@ - trygvis-base-syslog when: trygvis_base__syslog block: - - name: - vars: + - vars: items: - rsyslog apt: name: "{{ items }}" state: present install_recommends: no + +- become: true + tags: + - trygvis-base + - trygvis-base-journald + when: trygvis_base__journald + block: + - stat: + path: /var/log/journal + register: journal_log + + - when: not (journal_log.stat.isdir is defined and journal_log.stat.isdir) + file: + path: /var/log/journal + state: directory + notify: reload journalctl + + - when: not (journal_log.stat.isdir is defined and journal_log.stat.isdir) + command: /bin/systemd-tmpfiles --create --prefix /var/log/journal + notify: reload journalctl |