Skip to content

Commit 8ac806c

Browse files
martinpittrichm
authored andcommitted
refactor: Re-unify service disabling and stopping
Commit 8b6916a split the rsyslog.service disabling and stopping to restrict the latter to booted environments. Use `omit` instead to simplify.
1 parent 555b79a commit 8ac806c

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

roles/rsyslog/tasks/main_core.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -379,19 +379,11 @@
379379
systemd:
380380
name: rsyslog.service
381381
enabled: false
382+
state: "{{ 'stopped' if __logging_is_booted else omit }}"
382383
when:
383384
- not __rsyslog_enabled | bool
384385
- not rsyslog_in_image | default(false) | bool
385386

386-
- name: Stop rsyslog service
387-
systemd:
388-
name: rsyslog.service
389-
state: stopped
390-
when:
391-
- __logging_is_booted
392-
- not __rsyslog_enabled | bool
393-
- not rsyslog_in_image | default(false) | bool
394-
395387
- name: Check rsyslog version
396388
debug:
397389
msg: "Rsyslog version must be >= 8.37.0-7.2"

0 commit comments

Comments
 (0)