Keep persistent systemd journals
This patch enables persistent systemd journals and allows a deployer to disable the option if needed. The disk space requirements are extremely low since the files are stored in binary format. It is significantly less storage than rsyslog requires. Closes-Bug: 1748195 Change-Id: I4de267f2839c5022e83a07fa7779f242808df5c0
This commit is contained in:
parent
bb153f9144
commit
181f6cea3a
|
@ -144,3 +144,6 @@ opensuse_mirror_obs: "{{ opensuse_mirror }}"
|
|||
opensuse_repo_oss_url: "{{ opensuse_mirror }}/distribution/leap/{{ ansible_distribution_version }}/repo/oss/"
|
||||
opensuse_repo_update_url: "{{ opensuse_mirror }}/update/leap/{{ ansible_distribution_version }}/oss/"
|
||||
opensuse_obs_cloud_repo_url: "{{ opensuse_mirror_obs }}/repositories/Cloud:/OpenStack:/Pike/openSUSE_Leap_{{ ansible_distribution_version }}"
|
||||
|
||||
# Keep a history of systemd journals on disk after reboots
|
||||
openstack_host_keep_journals: yes
|
||||
|
|
|
@ -18,3 +18,9 @@
|
|||
name: "sysstat"
|
||||
state: "restarted"
|
||||
enabled: "yes"
|
||||
|
||||
- name: Restart systemd-journald
|
||||
service:
|
||||
name: systemd-journald
|
||||
state: restarted
|
||||
enabled: yes
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Persistent systemd journals are now enabled. This allows deployers to keep
|
||||
older systemd journals on disk for review. The disk space requirements are
|
||||
extremely low since the journals are stored in binary format. The default
|
||||
location for persistent journals is in ``/var/log/journal``.
|
||||
|
||||
Deployers can opt out of this change by setting
|
||||
``openstack_host_keep_journals`` to ``no``.
|
|
@ -85,3 +85,24 @@
|
|||
- name: Configure sysstat
|
||||
include: openstack_sysstat.yml
|
||||
when: openstack_host_sysstat_enabled | bool
|
||||
|
||||
- name: Create a directory to hold systemd journals on disk
|
||||
file:
|
||||
path: /var/log/journal
|
||||
state: directory
|
||||
register: journald_directory
|
||||
when:
|
||||
- openstack_host_keep_journals | bool
|
||||
|
||||
# NOTE(mhayden): The linter is skipped here since the command does not create
|
||||
# any files. The command ensures that proper permissions and SELinux contests
|
||||
# are set.
|
||||
- name: Create tmpfiles structure in journald directory
|
||||
command: systemd-tmpfiles --create --prefix /var/log/journal
|
||||
when:
|
||||
- journald_directory | changed
|
||||
- openstack_host_keep_journals | bool
|
||||
notify:
|
||||
- Restart systemd-journald
|
||||
tags:
|
||||
- skip_ansible_lint
|
||||
|
|
Loading…
Reference in New Issue