Skip to content

Instantly share code, notes, and snippets.

@wabouhamad
Created September 8, 2017 15:33
Show Gist options
  • Save wabouhamad/e0c2cb8937ecbf15870b34f3d669a8f3 to your computer and use it in GitHub Desktop.
Save wabouhamad/e0c2cb8937ecbf15870b34f3d669a8f3 to your computer and use it in GitHub Desktop.
OCP 3.6 Ansible playbook to tune journald
name: journald optimizations to allow for increased logging rates
hosts: all
gather_facts: False
tasks:
- name: Stop and disable rsyslog
systemd:
name: "{{ item }}"
state: stopped
enabled: no
with_items:
- rsyslog
- name: Enable journald persistence
ini_file:
dest: "/etc/systemd/journald.conf"
section: Journal
option: Storage
value: "Persistent"
no_extra_spaces: yes
- name: remove journald rate limit burst limit
ini_file:
dest: "/etc/systemd/journald.conf"
section: Journal
option: RateLimitBurst
value: "0"
no_extra_spaces: yes
- name: remove journald rate limit interval
ini_file:
dest: "/etc/systemd/journald.conf"
section: Journal
option: RateLimitIntervalSec
value: "0"
no_extra_spaces: yes
- name: Create /var/log/journal
file:
path: /var/log/journal
state: directory
owner: root
group: root
mode: 0755
- name: Restart journald
systemd:
name: "{{ item }}"
state: restarted
with_items:
- systemd-journald
- name: Clean up yum cache
command: yum clean all
- name: Remove all yum cache directories
command: rm -rf /var/cache/yum/*
@shnela
Copy link

shnela commented Mar 17, 2020

 [/etc/systemd/journald.conf:15] Failed to parse storage setting, ignoring: Persistent

It should be persistent

@alexpovel
Copy link

To add to that, persistent will create /var/log/journal automatically. auto would require manual creation of that directory for persistency. Found this in man journald.conf under Storage=.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment