I see how the 'stat + when' pattern would work for a single item, but
not when there's a list of templates that must be checked. This code:
- local_action: stat path=nginx/{{ item }}.j2
register: nginx_sites_exist
with_items: apps
would register a var like
{
"nginx_sites_exist": {
"changed": false,
"msg": "All items completed",
"results": [
{
"changed": false,
"invocation": {
"module_args": "path=nginx/cc-insert.j2",
"module_name": "stat"
},
"item": "cc-insert",
"stat": {
"exists": false
}
},
{
"changed": false,
"invocation": {
"module_args": "path=nginx/ftpbridge.j2",
"module_name": "stat"
},
"item": "ftpbridge",
"stat": {
"exists": false
}
}
]
}
}
How could this be passed to a 'when' statement?
--
Jordi Funollet Pujol
http://www.linkedin.com/in/jordifunollet
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/1415614207.633747.189087893.1AD6B949%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.