1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-10-31 10:17:58 +01:00
tldr/pages/common/ansible.md
Starbeamrainbowlabs 45ec3033c0
Revert "multiple pages: add homepages"
This reverts commit 347e557303.
2018-12-19 23:33:18 +00:00

765 B

ansible

Manage groups of computers remotely over SSH. Use the /etc/ansible/hosts file to add new groups/hosts.

  • List hosts belonging to a group:

ansible {{group}} --list-hosts

  • Ping a group of hosts by invoking the ping module:

ansible {{group}} -m ping

  • Display facts about a group of hosts by invoking the setup module:

ansible {{group}} -m setup

  • Execute a command on a group of hosts by invoking command module with arguments:

ansible {{group}} -m command -a '{{my_command}}'

  • Execute a command with administrative privileges:

ansible {{group}} --become --ask-become-pass -m command -a '{{my_command}}'

  • Execute a command using a custom inventory file:

ansible {{group}} -i {{inventory_file}} -m command -a '{{my_command}}'