diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-07-31 09:24:09 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-08-08 09:03:13 +0200 |
commit | b013a2d14b99eb3d76877e52f863832e421d3d70 (patch) | |
tree | b3d46fe1f681e9f1fe8b7da376d186302bd04f18 /ansible/roles/trygvis-base/tasks/main.yml | |
parent | d50110f25674f218dd7e528a6a74fbbe04599688 (diff) | |
download | infra-b013a2d14b99eb3d76877e52f863832e421d3d70.tar.gz infra-b013a2d14b99eb3d76877e52f863832e421d3d70.tar.bz2 infra-b013a2d14b99eb3d76877e52f863832e421d3d70.tar.xz infra-b013a2d14b99eb3d76877e52f863832e421d3d70.zip |
o Persisting journald logs by default.
Diffstat (limited to 'ansible/roles/trygvis-base/tasks/main.yml')
-rw-r--r-- | ansible/roles/trygvis-base/tasks/main.yml | 23 |
1 files changed, 21 insertions, 2 deletions
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 |