Sort file names within templates
For consistent templating and to avoid unnecessary service restarts, sort the list of gathered log file names. Change-Id: I838a791b1241de847f8f03ff5a4f4a3f117b4e43
This commit is contained in:
parent
3b917569cd
commit
e70d85f255
|
@ -1,7 +1,7 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
# Log files
|
||||
{% for log_file in rsyslog_client_all_log_files %}
|
||||
{% for log_file in rsyslog_client_all_log_files | sort %}
|
||||
$InputFileName {{ log_file }}
|
||||
$InputFileTag {{ log_file.split('.log')[0] | basename }}:
|
||||
$InputFileStateFile state-{{ log_file.split('.log')[0] | basename }}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% for log_file in rsyslog_client_all_log_files %}
|
||||
{% for log_file in rsyslog_client_all_log_files | sort %}
|
||||
{{ log_file }}
|
||||
{% endfor %}
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue