@@ -7,6 +7,8 @@ in ansible and were most convient to be made pluggable.
...
@@ -7,6 +7,8 @@ in ansible and were most convient to be made pluggable.
This section will explore these features, though they are generally not common in terms of things people would look to extend.
This section will explore these features, though they are generally not common in terms of things people would look to extend.
.. _developing_connection_type_plugins:
Connection Type Plugins
Connection Type Plugins
-----------------------
-----------------------
...
@@ -20,6 +22,8 @@ directory. The value of 'smart' for a connection allows selection of paramiko
...
@@ -20,6 +22,8 @@ directory. The value of 'smart' for a connection allows selection of paramiko
More documentation on writing connection plugins is pending, though you can jump into lib/ansible/runner/connection_plugins and figure
More documentation on writing connection plugins is pending, though you can jump into lib/ansible/runner/connection_plugins and figure
things out pretty easily.
things out pretty easily.
.. _developing_lookup_plugins:
Lookup Plugins
Lookup Plugins
--------------
--------------
...
@@ -28,6 +32,8 @@ Language constructs like "with_fileglob" and "with_items" are implemented via lo
...
@@ -28,6 +32,8 @@ Language constructs like "with_fileglob" and "with_items" are implemented via lo
More documentation on writing connection plugins is pending, though you can jump into lib/ansible/runner/lookup_plugins and figure
More documentation on writing connection plugins is pending, though you can jump into lib/ansible/runner/lookup_plugins and figure
things out pretty easily.
things out pretty easily.
.. _developing_vars_plugins:
Vars Plugins
Vars Plugins
------------
------------
...
@@ -40,6 +46,8 @@ things out pretty easily.
...
@@ -40,6 +46,8 @@ things out pretty easily.
If you find yourself wanting to write a vars_plugin, it's more likely you should write an inventory script instead.
If you find yourself wanting to write a vars_plugin, it's more likely you should write an inventory script instead.
.. _developing_filter_plugins:
Filter Plugins
Filter Plugins
--------------
--------------
...
@@ -47,12 +55,15 @@ If you want more Jinja2 filters available in a Jinja2 template (filters like to_
...
@@ -47,12 +55,15 @@ If you want more Jinja2 filters available in a Jinja2 template (filters like to_
Jump into lib/ansible/runner/filter_plugins/ for details.
Jump into lib/ansible/runner/filter_plugins/ for details.
.. _developing_callbacks:
Callbacks
Callbacks
---------
---------
Callbacks are one of the more interesting plugin types. Adding additional callback plugins to Ansible allows for adding new behaviors when responding to events.
Callbacks are one of the more interesting plugin types. Adding additional callback plugins to Ansible allows for adding new behaviors when responding to events.
.. _callback_examples:
Examples
Examples
++++++++
++++++++
...
@@ -64,23 +75,26 @@ when playbooks complete.
...
@@ -64,23 +75,26 @@ when playbooks complete.
The 'osx_say' callback provided is particularly entertaining -- it will respond with computer synthesized speech on OS X in relation
The 'osx_say' callback provided is particularly entertaining -- it will respond with computer synthesized speech on OS X in relation
to playbook events, and is guaranteed to entertain and/or annoy coworkers.
to playbook events, and is guaranteed to entertain and/or annoy coworkers.
.. _configuring_callbacks:
Configuring
Configuring
+++++++++++
+++++++++++
To active a callback drop it in a callback directory as configured in ansible.cfg.
To active a callback drop it in a callback directory as configured in ansible.cfg.
.. _callback_development:
Development
Development
+++++++++++
+++++++++++
More information will come later, though see the source of any of the existing callbacks and you should be able to get started quickly.
More information will come later, though see the source of any of the existing callbacks and you should be able to get started quickly.
They should be reasonably self explanatory.
They should be reasonably self explanatory.
.. _distributing_plugins:
Distributing Plugins
Distributing Plugins
--------------------
--------------------
.. versionadded:: 0.8
Plugins are loaded from both Python's site_packages (those that ship with ansible) and a configured plugins directory, which defaults
Plugins are loaded from both Python's site_packages (those that ship with ansible) and a configured plugins directory, which defaults
to /usr/share/ansible/plugins, in a subfolder for each plugin type::
to /usr/share/ansible/plugins, in a subfolder for each plugin type::
Technically ansible doesn't need a configuration file, but OS packages are likely to include a default one in /etc/ansible/ansible.cfg
that you may customize. You can also install your own copy in ~/.ansible.cfg or keep a copy in a directory relative to your playbook named "ansible.cfg".
For what values you can use in this file, see `the configuration file on github <https://github.com/ansible/ansible/blob/devel/examples/ansible.cfg>`_.
See `intro_configuration`.
Generally you would configure the default module path or connection type here, among other things, though the defaults are usually
Yes! See `AnsibleWorks.com <http://ansibleworks.com>`_ or email `info@ansibleworks.com <mailto:info@ansibleworks.com>`_.
Yes! See `AnsibleWorks.com <http://ansibleworks.com>`_ or email `info@ansibleworks.com <mailto:info@ansibleworks.com>`_.
.. _web_interface:
Is there a web interface / REST API / etc?
++++++++++++++++++++++++++++++++++++++++++
Yes! AnsibleWorks makes a great product that makes Ansible even more powerful
and easy to use: `AnsibleWorks AWX <http://ansibleworks.com/ansible-awx/>`
.. _docs_contributions:
How do I submit a change to the documentation?
How do I submit a change to the documentation?
++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++
Great question! Documentation for Ansible is kept in the main project git repository, and complete instructions for contributing can be found in the docs README `viewable on GitHub <https://github.com/ansible/ansible/tree/devel/docsite/latest#readme>`_. Thanks!
Great question! Documentation for Ansible is kept in the main project git repository, and complete instructions for contributing can be found in the docs README `viewable on GitHub <https://github.com/ansible/ansible/tree/devel/docsite/latest#readme>`_. Thanks!
.. _i_dont_see_my_question:
I don't see my question here
I don't see my question here
++++++++++++++++++++++++++++
++++++++++++++++++++++++++++
See the "Resources" section of the documentation for a link to the IRC and Google Group.
We're happy to help.
See the "Resources" section of the documentation home page for a link to the IRC and Google Group.
@@ -22,6 +24,8 @@ Requirements for the AWS modules are minimal. All of the modules require and ar
...
@@ -22,6 +24,8 @@ Requirements for the AWS modules are minimal. All of the modules require and ar
You can also install it via pip if you want.
You can also install it via pip if you want.
.. _aws_provisioning:
Provisioning
Provisioning
````````````
````````````
...
@@ -81,9 +85,13 @@ Rather than include configuration inline, you may also choose to just do it as a
...
@@ -81,9 +85,13 @@ Rather than include configuration inline, you may also choose to just do it as a
The method above ties the configuration of a host with the provisioning step. This isn't always ideal and leads us onto the next section.
The method above ties the configuration of a host with the provisioning step. This isn't always ideal and leads us onto the next section.
:: _aws_advanced:
Advanced Usage
Advanced Usage
``````````````
``````````````
:: _aws_host_inventory:
Host Inventory
Host Inventory
++++++++++++++
++++++++++++++
...
@@ -99,6 +107,8 @@ You may wish to schedule a regular refresh of the inventory cache to accommodate
...
@@ -99,6 +107,8 @@ You may wish to schedule a regular refresh of the inventory cache to accommodate
Put this into a crontab as appropriate to make calls from your Ansible master server to the EC2 API endpoints and gather host information. The aim is to keep the view of hosts as up-to-date as possible, so schedule accordingly. Playbook calls could then also be scheduled to act on the refreshed hosts inventory after each refresh. This approach means that machine images can remain "raw", containing no payload and OS-only. Configuration of the workload is handled entirely by Ansible.
Put this into a crontab as appropriate to make calls from your Ansible master server to the EC2 API endpoints and gather host information. The aim is to keep the view of hosts as up-to-date as possible, so schedule accordingly. Playbook calls could then also be scheduled to act on the refreshed hosts inventory after each refresh. This approach means that machine images can remain "raw", containing no payload and OS-only. Configuration of the workload is handled entirely by Ansible.
:: _aws_pull:
Pull Configuration
Pull Configuration
++++++++++++++++++
++++++++++++++++++
...
@@ -108,6 +118,8 @@ More information on pull-mode playbooks can be found `here <http://www.ansiblewo
...
@@ -108,6 +118,8 @@ More information on pull-mode playbooks can be found `here <http://www.ansiblewo
(Various developments around Ansible are also going to make this easier in the near future. Stay tuned!)
(Various developments around Ansible are also going to make this easier in the near future. Stay tuned!)
:: _aws_autoscale:
AWX Autoscaling
AWX Autoscaling
+++++++++++++++
+++++++++++++++
...
@@ -118,11 +130,15 @@ to reconfigure ephmeral nodes. See the AWX documentation for more details. Cli
...
@@ -118,11 +130,15 @@ to reconfigure ephmeral nodes. See the AWX documentation for more details. Cli
A benefit of using the callback in AWX over pull mode is that job results are still centrally recorded and less information has to be shared
A benefit of using the callback in AWX over pull mode is that job results are still centrally recorded and less information has to be shared
with remote hosts.
with remote hosts.
:: _aws_use_cases:
Use Cases
Use Cases
`````````
`````````
This section covers some usage examples built around a specific use case.
This section covers some usage examples built around a specific use case.
:: _aws_cloudformation_example:
Example 1
Example 1
+++++++++
+++++++++
...
@@ -132,6 +148,8 @@ Provision instances with your tool of choice and consider using the inventory pl
...
@@ -132,6 +148,8 @@ Provision instances with your tool of choice and consider using the inventory pl
.. note:: Ansible also has a cloudformation module you may wish to explore.
.. note:: Ansible also has a cloudformation module you may wish to explore.
:: _aws_autoscale_example:
Example 2
Example 2
+++++++++
+++++++++
...
@@ -139,6 +157,8 @@ Example 2
...
@@ -139,6 +157,8 @@ Example 2
There are several approaches to this use case. The first is to use the inventory plugin to regularly refresh host information and then target hosts based on the latest inventory data. The second is to use ansible-pull triggered by a user-data script (specified in the launch configuration) which would then mean that each instance would fetch Ansible and the latest playbook from a git repository and run locally to configure itself. You could also use the AWX callback feature.
There are several approaches to this use case. The first is to use the inventory plugin to regularly refresh host information and then target hosts based on the latest inventory data. The second is to use ansible-pull triggered by a user-data script (specified in the launch configuration) which would then mean that each instance would fetch Ansible and the latest playbook from a git repository and run locally to configure itself. You could also use the AWX callback feature.
:: _aws_builds:
Example 3
Example 3
+++++++++
+++++++++
...
@@ -154,6 +174,8 @@ And in your playbook::
...
@@ -154,6 +174,8 @@ And in your playbook::
.. note:: more examples of this are pending. You may also be interested in the ec2_ami module for taking AMIs of running instances.
.. note:: more examples of this are pending. You may also be interested in the ec2_ami module for taking AMIs of running instances.
@@ -19,6 +19,8 @@ Before we dive into playbooks, configuration management, deployment, and orchest
...
@@ -19,6 +19,8 @@ Before we dive into playbooks, configuration management, deployment, and orchest
basic information. We'll go over how to execute ad-hoc commands in parallel across your nodes using /usr/bin/ansible. We'll also see
basic information. We'll go over how to execute ad-hoc commands in parallel across your nodes using /usr/bin/ansible. We'll also see
what sort of modules are available in Ansible's core (though you can also write your own, which we'll also show later).
what sort of modules are available in Ansible's core (though you can also write your own, which we'll also show later).
.. _an_introduction:
An Introduction
An Introduction
```````````````
```````````````
...
@@ -34,6 +36,8 @@ An Introduction
...
@@ -34,6 +36,8 @@ An Introduction
intro_configuration
intro_configuration
modules
modules
.. _overview:
Overview
Overview
````````
````````
...
@@ -42,6 +46,8 @@ Overview
...
@@ -42,6 +46,8 @@ Overview
:width: 788px
:width: 788px
:height: 436px
:height: 436px
.. _introduction_to_playbooks:
An Introduction to Playbooks
An Introduction to Playbooks
````````````````````````````
````````````````````````````
...
@@ -68,6 +74,21 @@ ways to organize playbooks and the files they include, and we'll offer up some s
...
@@ -68,6 +74,21 @@ ways to organize playbooks and the files they include, and we'll offer up some s
It is recommended to look at `Example Playbooks <https://github.com/ansible/ansible-examples>`_ while reading along with the playbook documentation. These illustrate best practices as well as how to put many of the various concepts together.
It is recommended to look at `Example Playbooks <https://github.com/ansible/ansible-examples>`_ while reading along with the playbook documentation. These illustrate best practices as well as how to put many of the various concepts together.
.. ansibleworks_awx:
Upgrading the Ansible Experience: AnsibleWorks AWX
`AnsibleWorks <http://ansibleworks.com>`_, who also sponsors the AnsibleWorks community, also produces 'AWX', which is a web-based tool that makes Ansible even more easy to use for IT teams of all kinds. It's designed to be the hub for all of your automation tasks.
AWX allows you to control access to who can access what, even allowing sharing of SSH credentials without someone being able to transfer those credentials. Inventory can be graphically managed or synced with a widde variety of cloud sources. It logs all of your jobs, integrates well with LDAP, and has an amazing browseable REST API.
Find out more about AWX features and how to download it on the `AWX webpage <http://ansibleworks.com/ansible-awx>`_. AWX
is free for usage for up to 10 nodes, and comes bundled with amazing support from AnsibleWorks. As you would expect, AWX is
installed using Ansible playbooks!
.. _advanced_topics_in_playbooks:
Advanced Topics In Playbooks
Advanced Topics In Playbooks
````````````````````````````
````````````````````````````
...
@@ -87,7 +108,9 @@ these only if they seem relevant or useful to your environment.
...
@@ -87,7 +108,9 @@ these only if they seem relevant or useful to your environment.
playbooks_lookups
playbooks_lookups
playbooks_prompts
playbooks_prompts
playbooks_tags
playbooks_tags
.. _detailed_guides:
Detailed Guides
Detailed Guides
```````````````
```````````````
...
@@ -104,6 +127,8 @@ A chance to dive into some more topics in depth:
...
@@ -104,6 +127,8 @@ A chance to dive into some more topics in depth:
Pending topics may include: Vagrant, Docker, Jenkins, Rackspace Cloud, Google Compute Engine, Linode/Digital Ocean, Continous Deployment,
Pending topics may include: Vagrant, Docker, Jenkins, Rackspace Cloud, Google Compute Engine, Linode/Digital Ocean, Continous Deployment,
and more.
and more.
.. _community_information:
Community Information
Community Information
`````````````````````
`````````````````````
...
@@ -113,6 +138,8 @@ other users, introducing new people to Ansible, or helping with the software or
...
@@ -113,6 +138,8 @@ other users, introducing new people to Ansible, or helping with the software or
How to interact <https://github.com/ansible/ansible/blob/devel/CONTRIBUTING.md>
How to interact <https://github.com/ansible/ansible/blob/devel/CONTRIBUTING.md>
.. _developer_information:
Developer Information
Developer Information
`````````````````````
`````````````````````
...
@@ -128,6 +155,8 @@ with other solutions in your environment.
...
@@ -128,6 +155,8 @@ with other solutions in your environment.
developing_plugins
developing_plugins
REST API <http://ansibleworks.com/ansibleworks-awx>
REST API <http://ansibleworks.com/ansibleworks-awx>