Skip to content

Commit 77ead1e

Browse files
committed
Merge pull request realpython#422 from gregimba/master
added ansible description and example
2 parents b20eb4c + 68f2baa commit 77ead1e

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

docs/scenarios/admin.rst

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,46 @@ monitoring is `glance <https://github.com/nicolargo/glances/>`_.
178178

179179
Ansible
180180
-------
181+
`Ansible <http://ansible.com/>`_ is a open source system automation tool. The biggest advantage over Puppet or Chef is it does not require an agent on the client machine. Playbooks are Ansible’s configuration, deployment, and orchestration language and are written in in yaml with jinja2 for templating.
181182

182-
.. todo:: Write about Ansible
183+
Ansible supports Python versions 2.6 and 2.7 and can be installed via pip:
183184

184-
`Ansible Documentation
185-
<http://www.ansibleworks.com/docs/>`_
185+
.. code-block:: console
186+
187+
$ pip install ansible
188+
189+
Ansible requires a inventory file that describes the hosts it has access to. Here is an example of a host and
190+
playbook that will ping all the hosts in the inventory file:
191+
192+
Here is an example inventory file:
193+
hosts.yml
194+
195+
.. code-block:: yaml
196+
197+
[server_name]
198+
127.0.0.1
199+
200+
Here is an example playbook:
201+
ping.yml
202+
203+
.. code-block:: yaml
204+
205+
---
206+
- hosts: all
207+
208+
tasks:
209+
- name: ping
210+
action: ping
211+
212+
To run the playbook:
213+
214+
.. code-block:: console
215+
216+
$ ansible-playbook ping.yml -i hosts.yml --ask-pass
217+
218+
That Ansible playbook will ping all of the servers in the hosts.yml file. You can also select groups of servers using Ansible. For more information about Ansible read the docs.
219+
220+
`Ansible Docs <http://docs.ansible.com/>`_
186221

187222

188223
Chef

0 commit comments

Comments
 (0)