openstack-ansible-plugins/action
Andy McCrae 2ab0160123 Utilise sorted to ensure no random changes
This is a manual backport of a5ef4ea.
The config_template plugin was unified in Queens.

As part of the ceph-ansible project, this change was put in:
ceph/ceph-ansible@ec04221
This was to handle the case where the config would change, initiating a
restart handler, even though no actual change happened.

We can juse use sorted() since we are passing back a list with .items()
which can then be sorted.

The above change didn't include a change to ensure the order of the
sections, which meant that although the individual items were sorted the
sections could change order causing unnecessary changes.

Additionally, this adds a test to retemplate the file 3 times, with a
lot more sections to ensure the order remains the same, this will fail
when the config template changes even though no changes have happened.

Change-Id: I7c7cd9ef1dd767a2a5d754ac4663cf8655dd60c2
(cherry picked from commit 542835cb50)
2018-03-21 15:40:22 +00:00
..
_v1_config_template.py Utilise sorted to ensure no random changes 2018-03-21 15:40:22 +00:00
_v2_config_template.py Utilise sorted to ensure no random changes 2018-03-21 15:40:22 +00:00
config_template.py Update the config_template plugin for ansible2 2016-03-30 16:13:26 -05:00