parent
10caf2538a
commit
e7a7bcee4b
@ -77,9 +77,22 @@
|
|||||||
- name: Print validation error output
|
- name: Print validation error output
|
||||||
debug:
|
debug:
|
||||||
msg: |
|
msg: |
|
||||||
✗ Validation failed!
|
##################################################
|
||||||
stdout: {{ validation_result.stdout | default('(empty)') }}
|
❌ RSYSLOG VALIDATION FAILED
|
||||||
stderr: {{ validation_result.stderr | default('(empty)') }}
|
##################################################
|
||||||
|
|
||||||
|
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
|
when: validation_result.rc != 0
|
||||||
|
|
||||||
- name: Restore rsyslog.conf from backup
|
- name: Restore rsyslog.conf from backup
|
||||||
@ -99,10 +112,15 @@
|
|||||||
|
|
||||||
- name: Fail pipeline — config restored to previous working state
|
- name: Fail pipeline — config restored to previous working state
|
||||||
fail:
|
fail:
|
||||||
msg: >
|
msg: |
|
||||||
rsyslog configuration validation failed (rc={{ validation_result.rc }}).
|
##################################################
|
||||||
The previous working config has been restored. No service restart was performed.
|
❌ 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)') }}
|
stderr: {{ validation_result.stderr | default('(empty)') }}
|
||||||
|
##################################################
|
||||||
when: validation_result.rc != 0
|
when: validation_result.rc != 0
|
||||||
|
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
@ -118,6 +136,10 @@
|
|||||||
- name: Print success status
|
- name: Print success status
|
||||||
debug:
|
debug:
|
||||||
msg: |
|
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
|
when: validation_result.rc == 0
|
||||||
@ -30,7 +30,7 @@ module(load="imklog" permitnonkernelfacility="on")
|
|||||||
|
|
||||||
# Use traditional timestamp format.
|
# Use traditional timestamp format.
|
||||||
# To enable high precision timestamps, comment out the following line.
|
# To enable high precision timestamps, comment out the following line.
|
||||||
#
|
this is a test#################################
|
||||||
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
|
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
|
||||||
|
|
||||||
# Filter duplicated messages
|
# Filter duplicated messages
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user