Skip to content

Instantly share code, notes, and snippets.

View oyearunpal's full-sized avatar
:octocat:
On GitHub after a long time!

Arun Pal oyearunpal

:octocat:
On GitHub after a long time!
View GitHub Profile
@lilongen
lilongen / run-ansible-with-any-host-without-inventory
Last active May 5, 2023 23:16
How to run Ansible without specifying the inventory but the host directly?
Question:
. How to run Ansible without specifying the inventory but the host directly?
. Run a playbook or command with arbitrary host not in the inventory hosts list?
. run ansible with arbitrary host/ip without inventory?
Answer:
Surprisingly, the trick is to append a ,
The host parameter preceding the , can be either a hostname or an IPv4/v6 address.
ansible all -i example.com,