diff --git a/scripts/get-ansible-collection-requirements.yml b/scripts/get-ansible-collection-requirements.yml index e71108fa73..aca7c1a8aa 100644 --- a/scripts/get-ansible-collection-requirements.yml +++ b/scripts/get-ansible-collection-requirements.yml @@ -42,7 +42,7 @@ - name: Append user collections to filtered required collections set_fact: - galaxy_collections_list: "{{ galaxy_collections_list + [ item ] }}" + galaxy_collections_list: "{{ (galaxy_collections_list | default([])) + [ item ] }}" with_items: "{{ user_collections.collections }}" when: - user_collections.collections is defined diff --git a/scripts/get-ansible-role-requirements.yml b/scripts/get-ansible-role-requirements.yml index d988084e85..e7aa099fe9 100644 --- a/scripts/get-ansible-role-requirements.yml +++ b/scripts/get-ansible-role-requirements.yml @@ -132,7 +132,7 @@ - name: Append user overridden roles set_fact: - clone_roles: "{{ clone_roles + user_roles }}" + clone_roles: "{{ (clone_roles | default([])) + user_roles }}" - name: Clone git repos block: