For simple testing, you can use the "-i <host>," syntax (don't forget the comma at the end, it is required). This should only be used for testing purposes, we always recommend you use some sort of inventory file or dynamic inventory script for regular use.
On Mon, May 19, 2014 at 9:28 PM, Roger Qiu <[email protected]> wrote: > Sometimes I just want to contact a random host (this host's IP is > ephemeral/discovered during the operation), and execute an adhoc module. > > Is there a way to do this? > > It seems Ansible always requires an inventory file, but editing the > inventory file just to do an adhoc command on a host address that won't > exist afterwards is a bit unnecessary. > > -- > 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/1e7b0a62-ae25-4a6e-8381-4d14fcc9c70f%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/1e7b0a62-ae25-4a6e-8381-4d14fcc9c70f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAMFyvFjDJ9v2Niqynr6EYN3tPzq9E_6JgFO%3D%3Du-%3DUg7zscspww%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
