Skip to content

Commit

Permalink
Configure: Use wantlist on fpdict tasks (#291)
Browse files Browse the repository at this point in the history
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.

Co-authored-by: Miguel Angel <[email protected]>
  • Loading branch information
mamedin and Miguel Angel authored Mar 31, 2020
1 parent e4e3ab7 commit 195fe0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 195fe0a

Please sign in to comment.