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:
Jimmy McCrory 2017-11-07 20:08:26 -08:00
parent 3b917569cd
commit e70d85f255
2 changed files with 2 additions and 2 deletions

View File

@ -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 }}

View File

@ -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 %}
{