advice about "with_dict" and condicional correct way to use

29 views
Skip to first unread message

Alejandro Ferrari

unread,
Aug 24, 2015, 6:02:18 PM8/24/15
to Ansible Project
Hi all, 

I has this error:

UndefinedError: 'dict' object has no attribute 'JMSFileStoreName'


Into my dict just a few has this attributes, others not, I'll like to execute some task in case that this atribute exist, some way to check the status to avoid break the playbook?

This is my task:

- stat: path="/tmp/{{ item.key }}{{ server.sufix }}_{{item.value.JMSFileStoreName}}.py"
 
register: config_jms
  with_dict
: "{{AppName}}"
 
when: "{{item.value.JMSFileStoreName}} is defined"
  tags
: config_jms

thanks for any advice!
Ale

Brian Coca

unread,
Aug 24, 2015, 6:41:28 PM8/24/15
to Ansible Project
no moustaches in when and no chained defined using dot notation (.).

when: "'JMSFileStoreName' in item.value"


--
Brian Coca
Reply all
Reply to author
Forward
0 new messages