From d346562bb047df4a85470a1683fc6bf781bdb5d0 Mon Sep 17 00:00:00 2001 From: Miguel Angel Date: Tue, 31 Mar 2020 12:15:04 +0200 Subject: [PATCH] Configure: Use wantlist on fpdict tasks The loop keyword always requires a list, and it is known that in single item lists that lookup will not return a list. Adding wantlist=True to the lookup invocations allows to use dictionaries with a single item list. --- tasks/configure.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index df2d5fbe..f80b2700 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -236,7 +236,7 @@ "{{ archivematica_src_am_db_name }}" --batch --skip-column-names --execute="update fpr_fpcommand set enabled={{ item.value.enabled }} where {{ item.value.field_name }}=\"{{ item.key }}\";" - loop: "{{ lookup('dict',archivematica_src_configure_fpcommand|default({})) }}" + loop: "{{ lookup('dict',archivematica_src_configure_fpcommand|default({}),wantlist=True) }}" when: archivematica_src_configure_fpcommand is defined # - name: "Configure fprule settings" @@ -247,7 +247,7 @@ "{{ archivematica_src_am_db_name }}" --batch --skip-column-names --execute="update fpr_fprule set enabled={{ item.value.enabled }} where {{ item.value.field_name }}=\"{{ item.key }}\";" - loop: "{{ lookup('dict',archivematica_src_configure_fprule|default({})) }}" + loop: "{{ lookup('dict',archivematica_src_configure_fprule|default({}),wantlist=True) }}" when: archivematica_src_configure_fprule is defined - name: "Configure locations"