Ensure container configuration is sorted

We convert the container networks from a dict to a list in order to
allow us to enumerate the networks and assign an ID which is required
for lxc > 3.

Since dicts are unsorted we should ensure that we sort the converted
list so that unnecessary container restarts are not initiated on
subsequent runs, where the id for the network could change due to the
initial dict being unsorted.

Change-Id: I6f86b32e05adb2e0e4e214d2eb4aa67cbc283be1
This commit is contained in:
Andy McCrae 2018-05-29 10:57:30 +01:00
parent 2bc8bd5b0e
commit 4c8c76e4e1
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@
owner: "root"
group: "root"
mode: "0644"
with_indexed_items: "{{ lxc_container_networks_combined.values() | list }}"
with_indexed_items: "{{ lxc_container_networks_combined.values() | list | sort }}"
register: network_config
delegate_to: "{{ physical_host }}"