Your problem here is that the adhoc command only runs a single task, so you cannot run 'setup' (what runs when you gather_facts) to get the info you need, also adhoc tasks do not have a way to add a when: condition.
You need a playbook. -- Brian Coca -- 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/CAJ5XC8kLzz61N9Q6x-_GvYiPg1%2Bq788KP7o52SJzcmT%3Dhx94SQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
