Is there a way to use variables with ad-hoc commands

Hello,

I wanted to do that :

ansible -i inventories/production all -m shell -a "echo urok | nc {{ ansible_eth1.ipv4.address }} 2181 "

But it it seams that vars are not supported within ad-hoc commands. Right ?

Thanks

Alain

Variables are, including inventory variables and “-e”, but you cannot use fact gathering with /usr/bin/ansible, as they are a playbook only construct.

Ok thanks

Michael DeHaan <michael@ansible.com> napisał:

Variables are, including inventory variables and "-e", but you cannot
use
fact gathering with /usr/bin/ansible, as they are a playbook only
construct.

Will fact caching change that? Or is bin/ansible not aware of the cache?

Should change that, yes!