aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/journald/tasks
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-09-22 10:00:16 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-09-22 11:14:27 +0200
commitf139ba3fa6d2ed431ca411b2d35ddc3b5c9b1b68 (patch)
tree14bd5ae4a212d6a76b4e867c9a565af83c3ed09d /roles/journald/tasks
parentadd meta/runtime.yml (diff)
downloadinfra-ansible-f139ba3fa6d2ed431ca411b2d35ddc3b5c9b1b68.tar.gz
infra-ansible-f139ba3fa6d2ed431ca411b2d35ddc3b5c9b1b68.zip
journald: move service restart to handlers
Diffstat (limited to '')
-rw-r--r--roles/journald/tasks/main.yml30
1 files changed, 12 insertions, 18 deletions
diff --git a/roles/journald/tasks/main.yml b/roles/journald/tasks/main.yml
index 53e3393..38113a5 100644
--- a/roles/journald/tasks/main.yml
+++ b/roles/journald/tasks/main.yml
@@ -1,20 +1,14 @@
-- name: Make journald less noisy
+- name: Edit journald.conf
become: true
- block:
- - name: Edit journald.conf
- community.general.ini_file:
- dest: /etc/systemd/journald.conf
- section: Journal
- option: MaxLevelStore
- value: '{{ journald_log_level }}'
- owner: root
- group: root
- mode: '644'
- register: edited
+ community.general.ini_file:
+ dest: /etc/systemd/journald.conf
+ section: Journal
+ option: MaxLevelStore
+ value: '{{ journald_log_level }}'
+ owner: root
+ group: root
+ mode: '644'
+ notify: journald_restart
- - name: Restart systemd-journald
- ansible.builtin.systemd_service:
- daemon_reload: true
- name: systemd-journald
- state: restarted
- when: edited.changed
+- name: Restart systemd-journald if necessary
+ ansible.builtin.meta: flush_handlers