parent
10caf2538a
commit
e7a7bcee4b
@ -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
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user