Use attribute for sort

Using sort against dicts won't work in py3 (and may not work as expected
in py2), since dictionaries can not be compared unless we pass an
attribute value.

Change-Id: Ib11f78d639ea7d520896482253e7a12eb862d598
This commit is contained in:
Andy McCrae 2018-05-31 09:50:29 +01:00
parent 4c8c76e4e1
commit 7794e23cc0
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 | sort }}"
with_indexed_items: "{{ (lxc_container_networks_combined.values() | list) | sort(attribute='interface') }}"
register: network_config
delegate_to: "{{ physical_host }}"