diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..dac1013 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,7 @@ +--- + +- name: restart rsyslog + service: + name: rsyslog + state: restarted + diff --git a/tasks/rsyslog_client_post_install.yml b/tasks/rsyslog_client_post_install.yml index 6c37a52..1130767 100644 --- a/tasks/rsyslog_client_post_install.yml +++ b/tasks/rsyslog_client_post_install.yml @@ -13,14 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Stop rsyslog - service: - name: "rsyslog" - state: "stopped" - failed_when: false - tags: - - rsyslog_client-install - - name: Rsyslog Setup copy: src: "50-default.conf" @@ -29,6 +21,8 @@ group: "root" tags: - rsyslog_client-install + notify: + - restart rsyslog - name: Check if log dir exists stat: @@ -75,6 +69,8 @@ group: "root" tags: - rsyslog_client-config + notify: + - restart rsyslog - name: Write rsyslog target file template: @@ -85,6 +81,8 @@ when: (rsyslog_client_all_log_files | length) > 0 tags: - rsyslog_client-config + notify: + - restart rsyslog - name: Write log rotate file template: @@ -104,10 +102,3 @@ backrefs: yes tags: - rsyslog_client-install - -- name: Start rsyslog - service: - name: "rsyslog" - state: "started" - tags: - - rsyslog_client-config