forked from openstack/kayobe
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #291 from stackhpc/persistent-journal
Backport persistent journal
- Loading branch information
Showing
9 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
############################################################################### | ||
# Logging configuration | ||
|
||
# Journald storage. One of: volatile, persistent, auto, or none. Defaults to | ||
# `persistent`. | ||
journald_storage: persistent | ||
|
||
############################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
- name: Ensure Logging configuration is applied | ||
hosts: seed-hypervisor:seed:overcloud:infra-vms | ||
gather_facts: false | ||
vars: | ||
# NOTE(wszumski): Kayobe target env does not yet exist. | ||
ansible_python_interpreter: /usr/bin/python3 | ||
tags: | ||
- logging | ||
tasks: | ||
- name: Create /var/log/journal | ||
become: true | ||
file: | ||
path: /var/log/journal | ||
owner: "root" | ||
group: "root" | ||
mode: 0755 | ||
state: directory | ||
notify: Flush journal to disk | ||
when: journald_storage == "persistent" | ||
|
||
- name: Ensure journald drop in directory exists | ||
file: | ||
path: "/etc/systemd/journald.conf.d/" | ||
owner: "root" | ||
group: "root" | ||
mode: 0770 | ||
state: directory | ||
become: true | ||
|
||
- name: Ensure journald.conf overrides are set | ||
copy: | ||
content: | | ||
[Journal] | ||
Storage={{ journald_storage }} | ||
dest: /etc/systemd/journald.conf.d/kayobe.conf | ||
owner: root | ||
group: root | ||
mode: 0660 | ||
become: true | ||
notify: Restart journald | ||
|
||
handlers: | ||
- name: Restart journald | ||
service: | ||
name: systemd-journald | ||
state: restarted | ||
become: true | ||
- name: Flush journal to disk | ||
become: true | ||
command: journalctl --flush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
############################################################################### | ||
# Logging configuration | ||
|
||
# Journald storage. One of: volatile, persistent, auto, or none. Defaults to | ||
# `persistent`. | ||
#journald_storage: | ||
|
||
############################################################################### | ||
# Dummy variable to allow Ansible to accept this file. | ||
workaround_ansible_issue_8743: yes |
7 changes: 7 additions & 0 deletions
7
releasenotes/notes/adds-persistent-journal-99951ac651dc4a23.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
features: | ||
- | | ||
Configures journald to use a persistent storage by default. This allows you | ||
to keep journald logs across reboots and is controlled by the | ||
``journald_storage`` variable. See :kayobe-doc:`Kayobe documentation | ||
<configuration/reference/hosts#logging>` for more details. |