I am running a 16.04 Ubuntu desktop machine using VirtualBox. This VM has Ansible 2.4.0 installed. I am trying to run an ad-hoc ansible command just to prove it works (I am doin
I provide this host's IP address directly in the command. In this very case, according to my understanding, the inventory file is irrelevant.
Wrong. You specify host pattern, which should match hosts in your inventory. Inventory is a must for Ansible.
There's an option to specify "inline" inventory. For your case:
ansible all -i '10.0.3.248,' -m ping -u ubuntu
in this example: host pattern is all
, inventory is a list of a single host 10.0.3.248
.
Note comma at the end – it is important, this way Ansible understand that it is inline inventory, and not path to file.