results = {}
facts = {}
results['ansible_facts'] = facts
facts[var] = os.path.exists(name)
module.exit_json(**results)
- file_check: name=${item} var=filename
with_items:
- file1
- file2
- debug: msg="${filename}"
TASK: [file_check name=${item} var=filename] **********************************
<127.0.0.1> REMOTE_MODULE file_check name=file1 var=filename
ok: [127.0.0.1] => (item=file1) => {"ansible_facts": {"filename": false}, "changed": false, "item": "file1"}
<127.0.0.1> REMOTE_MODULE file_check name=file2 var=filename
ok: [127.0.0.1] => (item=file2) => {"ansible_facts": {"filename": false}, "changed": false, "item": "file2"}
TASK: [debug msg="${filename}"] ***********************************************
ok: [127.0.0.1] => {"msg": "${filename}"}
TASK: [file_check name=somefile var=filename] *********************************
<127.0.0.1> REMOTE_MODULE file_check name=somefile var=filename
ok: [127.0.0.1] => {"ansible_facts": {"filename": false}, "changed": false}
TASK: [debug msg="${filename}"] ***********************************************
ok: [127.0.0.1] => {"msg": "False"}
--
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 ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
- unpack: src=${item} dest=/somepath fact=unpack_dir
with_items:
- test.zip
- test.tar
- test.gz