Test for empty dict

16 views
Skip to first unread message

Ed Greenberg

unread,
Jun 8, 2017, 9:21:22 AM6/8/17
to Ansible Project
I have this:
TASK [debug] *******************************************************************
ok
: [localhost] => {
   
"changed": false,
   
"msg": {
       
"changed": false,
       
"volume": {}
   
}
}



I'd like to test for this condition, where volume is an empty dict.

I tried
when volume == {}

and, of course, got an error.

Any ideas?

Kai Stian Olstad

unread,
Jun 8, 2017, 10:35:34 AM6/8/17
to ansible...@googlegroups.com
Since you have not provided the error message I need to guess, you are
missing the colon after when.

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages