diff --git a/ansible/playbooks/apply.yml b/ansible/playbooks/apply.yml index 3f5d324..6850455 100644 --- a/ansible/playbooks/apply.yml +++ b/ansible/playbooks/apply.yml @@ -77,9 +77,22 @@ - name: Print validation error output debug: msg: | - ✗ Validation failed! - stdout: {{ validation_result.stdout | default('(empty)') }} - stderr: {{ validation_result.stderr | default('(empty)') }} + ################################################## + ❌ RSYSLOG VALIDATION FAILED + ################################################## + + HOST : {{ inventory_hostname }} ({{ ansible_host }}) + RC : {{ validation_result.rc }} + + --- STDOUT ---------------------------------- + {{ validation_result.stdout | default('(empty)') }} + + --- STDERR ---------------------------------- + {{ validation_result.stderr | default('(empty)') }} + + ################################################## + ⚠ Rolling back to previous working configuration + ################################################## when: validation_result.rc != 0 - name: Restore rsyslog.conf from backup @@ -99,10 +112,15 @@ - name: Fail pipeline — config restored to previous working state fail: - msg: > - rsyslog configuration validation failed (rc={{ validation_result.rc }}). - The previous working config has been restored. No service restart was performed. + msg: | + ################################################## + ❌ PIPELINE FAILED — rsyslog validation error + ################################################## + Previous working config has been restored. + rsyslog was NOT restarted. + rc={{ validation_result.rc }} stderr: {{ validation_result.stderr | default('(empty)') }} + ################################################## when: validation_result.rc != 0 # ------------------------------------------------------------------------- @@ -118,6 +136,10 @@ - name: Print success status debug: msg: | - ✓ rsyslog configuration deployed successfully. - Validation passed. Service restarted. + ################################################## + ✅ RSYSLOG CONFIGURATION DEPLOYED SUCCESSFULLY + ################################################## + HOST : {{ inventory_hostname }} ({{ ansible_host }}) + STATUS : Validation passed. Service restarted. + ################################################## when: validation_result.rc == 0 \ No newline at end of file diff --git a/files/rsyslog.conf b/files/rsyslog.conf index d8588d6..65d86e1 100644 --- a/files/rsyslog.conf +++ b/files/rsyslog.conf @@ -30,7 +30,7 @@ module(load="imklog" permitnonkernelfacility="on") # Use traditional timestamp format. # To enable high precision timestamps, comment out the following line. -# +this is a test################################# $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat # Filter duplicated messages