Difference between revisions of "Examples of Ansible execution modules"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
* <code>[[ansible -m raw]] DESTINATION_HOSTNAME -a uptime</code>
+
* <code>[[ansible -m raw]] [[DESTINATION_HOSTNAME]] -a uptime</code>
 
* <code>[[ansible -m shell]] DESTINATION_HOSTNAME -a uptime</code>
 
* <code>[[ansible -m shell]] DESTINATION_HOSTNAME -a uptime</code>
 
* <code>[[ansible -m command]] DESTINATION_HOSTNAME -a uptime</code> (Do not support some characters as: "|")
 
* <code>[[ansible -m command]] DESTINATION_HOSTNAME -a uptime</code> (Do not support some characters as: "|")
Line 6: Line 6:
  
 
* <code>[[ansible -m raw]] DESTINATION_HOSTNAME -a "[[df -kh]] | grep YOUR_STRING"</code>
 
* <code>[[ansible -m raw]] DESTINATION_HOSTNAME -a "[[df -kh]] | grep YOUR_STRING"</code>
 +
 +
== Errors ==
 +
ansible -m shell [[yourhost]] -a uptime
 +
[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: yourhost
  
 
== Example ==
 
== Example ==

Revision as of 13:27, 18 April 2023


Errors

ansible -m shell yourhost -a uptime
[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: yourhost

Example


Related terms

See also

Advertising: