Skip to content

Commit

Permalink
Align the Ansible remediation with Bash
Browse files Browse the repository at this point in the history
The Ansible remediation was not restarting the rsyslog service after
changing configuration files.
  • Loading branch information
marcusburghardt committed May 25, 2023
1 parent 5b905ef commit b8e785e
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
regexp: "{{ rsyslog_listen_legacy_regex }}"
replace: '# \1'
loop: "{{ rsyslog_legacy_remote_listen_files }}"
register: rsyslog_listen_legacy_comment
when:
- rsyslog_legacy_remote_listen_files | length > 0

Expand Down Expand Up @@ -68,5 +69,13 @@
regexp: "{{ rsyslog_listen_rainer_regex }}"
replace: '# \1'
loop: "{{ rsyslog_rainer_remote_listen_files }}"
register: rsyslog_listen_rainer_comment
when:
- rsyslog_rainer_remote_listen_files | length > 0

- name: "{{{ rule_title }}} - Restart Rsyslog if Any Line Were Commented Out"
ansible.builtin.service:
name: rsyslog
state: restarted
when:
- rsyslog_listen_legacy_comment is changed or rsyslog_listen_rainer_comment is changed

0 comments on commit b8e785e

Please sign in to comment.