From 781c14f99d377ba8b73c3ddc1c1c56fee1f60ed3 Mon Sep 17 00:00:00 2001 From: Samuel Tschiedel Date: Fri, 15 Sep 2017 09:34:36 -0300 Subject: [PATCH] Wrap `with_dict` arguments with "{{ }}" Without the wrapping, the default filter doesn't get applied and the run fails with "with_dict expects a dict" whenever the var is undefined. --- tasks/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 00cfbef..efab3e2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -65,7 +65,7 @@ state={{item.value.state | default('present')}} priv="{{item.value.priv | default('*.*:USAGE')}}" append_privs={{item.value.append_privs | default('no')}} - with_dict: mysql_users | default({}) + with_dict: "{{ mysql_users | default({}) }}" - name: Manage mysql databases mysql_db: login_user={{mysql_login_user}} @@ -76,5 +76,4 @@ name="{{item.key}}" state={{item.value.state | default('present')}} target={{item.value.target | default()}} - with_dict: mysql_dbs | default({}) - + with_dict: "{{ mysql_dbs | default({}) }}"