From ee4556fa5ccb87890e4531fd4b9b7f5975447ddb Mon Sep 17 00:00:00 2001 From: Stonewall Jackson Date: Mon, 13 Feb 2023 21:44:25 -0500 Subject: journald: add docs --- roles/journald/README.md | 33 ++++++++++++++++++++++ roles/journald/defaults/main.yml | 1 - .../templates/etc/systemd/journald.conf.j2 | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 roles/journald/README.md diff --git a/roles/journald/README.md b/roles/journald/README.md new file mode 100644 index 0000000..58ec604 --- /dev/null +++ b/roles/journald/README.md @@ -0,0 +1,33 @@ +Journald +======== + +Description +----------- + +The `journald` role configures the systemd journal. + +Variables +--------- + +This role **accepts** the following variables: + +Variable | Default | Description +-----------------------------|---------|------------ +`journald_persistent` | no | Persist journal to disk +`journald_forward_to_syslog` | yes | Forward journal messages to syslog socket +`journald_max_use` |   | Set [maximum journal size](https://www.freedesktop.org/software/systemd/man/journald.conf.html#SystemMaxUse=) + + +Usage +----- + +Example playbook: + +````yaml +- hosts: all + roles: + - role: journald + vars: + journald_persistent: no + journald_forward_to_syslog: yes +```` diff --git a/roles/journald/defaults/main.yml b/roles/journald/defaults/main.yml index 8c0ad8f..b89ddd9 100644 --- a/roles/journald/defaults/main.yml +++ b/roles/journald/defaults/main.yml @@ -1,3 +1,2 @@ journald_persistent: no journald_forward_to_syslog: yes -journald_max_use: null diff --git a/roles/journald/templates/etc/systemd/journald.conf.j2 b/roles/journald/templates/etc/systemd/journald.conf.j2 index 33c59ba..95a87ef 100644 --- a/roles/journald/templates/etc/systemd/journald.conf.j2 +++ b/roles/journald/templates/etc/systemd/journald.conf.j2 @@ -1,6 +1,6 @@ [Journal] Storage=auto -{% if journald_max_use %} +{% if journald_max_use is defined %} {{ 'System' if journald_persistent else 'Runtime' }}MaxUse={{ journald_max_use }} {% endif %} ForwardToSyslog={{ journald_forward_to_syslog | bool | to_json }} -- cgit