⌘K
ansible
all
Manage groups of computers remotely over SSH. (use the `/etc/ansible/hosts` file to add new groups/hosts). Some subcommands such as `galaxy` have their own usage documentation.
More info →Options (4)
-m, --module-namebooleanPing a group of hosts by invoking the ping module
Example:
ansible {{group}} {{[-m|--module-name]}} ping-a, --argsbooleanExecute a command on a group of hosts by invoking command module with arguments
Example:
ansible {{group}} {{[-m|--module-name]}} command {{[-a|--args]}} '{{my_command}}'-b, --becomebooleanExecute a command with administrative privileges
Example:
ansible {{group}} {{[-b|--become]}} --ask-become-pass {{[-m|--module-name]}} command {{[-a|--args]}} '{{my_command}}'-i, --inventorybooleanExecute a command using a custom inventory file
Example:
ansible {{group}} {{[-i|--inventory]}} {{inventory_file}} {{[-m|--module-name]}} command {{[-a|--args]}} '{{my_command}}'Examples (7)
List hosts belonging to a group
ansible group --list-hostsPing a group of hosts by invoking the ping module
ansible group [-m|--module-name] pingDisplay facts about a group of hosts by invoking the setup module
ansible group [-m|--module-name] setupExecute a command on a group of hosts by invoking command module with arguments
ansible group [-m|--module-name] command [-a|--args] 'my_command'Execute a command with administrative privileges
ansible group [-b|--become] --ask-become-pass [-m|--module-name] command [-a|--args] 'my_command'Execute a command using a custom inventory file
ansible group [-i|--inventory] inventory_file [-m|--module-name] command [-a|--args] 'my_command'List the groups in an inventory
ansible localhost [-m|--module-name] debug [-a|--args] 'var=groups.keys()'made by @shridhargupta | data from tldr-pages