summaryrefslogtreecommitdiffstats
path: root/roles/openshift_master/tasks/journald.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_master/tasks/journald.yml')
-rw-r--r--roles/openshift_master/tasks/journald.yml29
1 files changed, 29 insertions, 0 deletions
diff --git a/roles/openshift_master/tasks/journald.yml b/roles/openshift_master/tasks/journald.yml
new file mode 100644
index 000000000..a16cbe78e
--- /dev/null
+++ b/roles/openshift_master/tasks/journald.yml
@@ -0,0 +1,29 @@
+---
+- name: Checking for journald.conf
+ stat: path=/etc/systemd/journald.conf
+ register: journald_conf_file
+
+- name: Create journald persistence directories
+ file:
+ path: /var/log/journal
+ state: directory
+
+- 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
+ command: "systemctl restart systemd-journald"
+ retries: 3
+ delay: 5
+ register: result
+ until: result.rc == 0
+ when: journald_update | changed