Ansible Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Ansible =Execute a Shell Command on all Hosts in Some Groups= <pre> ansible masters,nodes -m shell -a"systemctl status docker | grep Activ...")
 
Line 2: Line 2:


* [[Ansible#Subjects|Ansible]]
* [[Ansible#Subjects|Ansible]]
=Ping all Hosts from a Group=
This will also list the hosts from that group.
<Pre>
ansible all -m ping
</pre>


=Execute a Shell Command on all Hosts in Some Groups=
=Execute a Shell Command on all Hosts in Some Groups=


<pre>
<pre>
ansible masters,nodes -m shell -a"systemctl status docker | grep Active"
ansible masters,nodes -m shell -a "systemctl status docker | grep Active"
</pre>
</pre>

Revision as of 12:58, 16 May 2017

Internal

Ping all Hosts from a Group

This will also list the hosts from that group.

ansible all -m ping

Execute a Shell Command on all Hosts in Some Groups

ansible masters,nodes -m shell -a "systemctl status docker | grep Active"