<p>Try this, to run an adhoc command with IP address</p>

<pre><code>ansible all -i 192.168.254.150, -m ping
192.168.254.150 | SUCCESS =&gt; {
    "changed": false, 
    "ping": "pong"
}
</code></pre>

<p>From man:</p>

<blockquote>
  <p>-i INVENTORY, --inventory=INVENTORY, --inventory-file=INVENTORY
                         specify inventory host path or <strong>comma separated host</strong></p>
</blockquote>

CC BY-SA 4.0
2020-03-12T10:31:26.320Z
2020-03-12T12:36:21.083Z
2020-03-12T12:36:21.083Z
Siva
<pre><code>$ 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
</code></pre>

CC BY-SA 4.0
2020-03-12T09:42:54.203Z
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
<ansible><ubuntu>
Can't ping client on ansible ,
Tazhar Masood
# Can't ping client on ansible ,

(Asked by: username_0 on 2020-03-12)

$ 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

**Tags:** ansible, ubuntu

> **Comments:**
> **username_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  

---

## 1 answers

### Answer by username_2 on 2020-03-12. Score: 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


---

