From 57d6e2e91e6bb12b50f96c712f8d8a99864ab56b Mon Sep 17 00:00:00 2001 From: Darius Karel Date: Wed, 23 Nov 2016 18:29:38 +0700 Subject: [PATCH] ansible: add page (#1153) --- pages/common/ansible.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pages/common/ansible.md diff --git a/pages/common/ansible.md b/pages/common/ansible.md new file mode 100644 index 0000000000..437f0148aa --- /dev/null +++ b/pages/common/ansible.md @@ -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}}'`