mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 05:42:09 +02:00
ansible: add page (#1153)
This commit is contained in:
parent
72461cfd7d
commit
57d6e2e91e
1 changed files with 28 additions and 0 deletions
28
pages/common/ansible.md
Normal file
28
pages/common/ansible.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
# 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}}'`
|
Loading…
Add table
Reference in a new issue