diff --git a/roles/cifmw_helpers/tasks/include_dir.yml b/roles/cifmw_helpers/tasks/include_dir.yml index d6a3682df..bf6f37465 100644 --- a/roles/cifmw_helpers/tasks/include_dir.yml +++ b/roles/cifmw_helpers/tasks/include_dir.yml @@ -29,7 +29,11 @@ included_file: "{{ _file_to_parse.path }}" ansible.builtin.include_tasks: file: include_file.yml - loop: "{{ _yaml_files.files }}" + # ansible.builtin.find does not guarantee sorted results, so without + # an explicit sort, include order (and therefore which file's + # variables win on conflicting keys) is filesystem-order dependent + # rather than deterministic. + loop: "{{ _yaml_files.files | sort(attribute='path') }}" loop_control: loop_var: _file_to_parse no_log: "{{ cifmw_helpers_no_log }}"