Skip to content

Ensure upgrades apply latest journald settings #5796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@

- include_vars: ../../../../roles/openshift_master/vars/main.yml

- name: Update journald config
include: ../../../../roles/openshift_master/tasks/journald.yml

- name: Remove any legacy systemd units and update systemd units
include: ../../../../roles/openshift_master/tasks/systemd_units.yml

Expand Down
22 changes: 22 additions & 0 deletions roles/openshift_master/tasks/journald.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
- name: Checking for journald.conf
stat: path=/etc/systemd/journald.conf
register: journald_conf_file

- name: Update journald setup
replace:
dest: /etc/systemd/journald.conf
regexp: '^(\#| )?{{ item.var }}=\s*.*?$'
replace: ' {{ item.var }}={{ item.val }}'
backup: yes
with_items: "{{ journald_vars_to_replace | default([]) }}"
when: journald_conf_file.stat.exists
register: journald_update

# I need to restart journald immediatelly, otherwise it gets into way during
# further steps in ansible
- name: Restart journald
systemd:
name: systemd-journald
state: restarted
when: journald_update | changed
25 changes: 3 additions & 22 deletions roles/openshift_master/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,31 +177,12 @@
local_facts:
no_proxy_etcd_host_ips: "{{ openshift_no_proxy_etcd_host_ips }}"

- name: Update journald config
include: journald.yml

- name: Install the systemd units
include: systemd_units.yml

- name: Checking for journald.conf
stat: path=/etc/systemd/journald.conf
register: journald_conf_file

- name: Update journald setup
replace:
dest: /etc/systemd/journald.conf
regexp: '^(\#| )?{{ item.var }}=\s*.*?$'
replace: ' {{ item.var }}={{ item.val }}'
backup: yes
with_items: "{{ journald_vars_to_replace | default([]) }}"
when: journald_conf_file.stat.exists
register: journald_update

# I need to restart journald immediatelly, otherwise it gets into way during
# further steps in ansible
- name: Restart journald
systemd:
name: systemd-journald
state: restarted
when: journald_update | changed

- name: Install Master system container
include: system_container.yml
when:
Expand Down