-1
$ ansible 192.168.254.150 -m ping

[WARNING]: Unable to parse /etc/ansible/hosts enable callback plugins as an
inventory source
[WARNING]: Unable to parse /etc/ansible/they can output to stdout but cannot be
'stdout' type. callback_whitelist = timer as an inventory source
[WARNING]: Unable to parse /etc/ansible/mail as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: 192.168.254.150
1
  • Hi Tazhar - we're going to need a bit more information than just the shell output. What version of ansible are you running? Do you have ssh keys set up? what kind of host is the target? etc – Bruce Becker Mar 12 '20 at 9:42
3

Try this, to run an adhoc command with IP address

ansible all -i 192.168.254.150, -m ping
192.168.254.150 | SUCCESS => {
    "changed": false, 
    "ping": "pong"
}

From man:

-i INVENTORY, --inventory=INVENTORY, --inventory-file=INVENTORY specify inventory host path or comma separated host

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.