mirror of https://github.com/ansible/ansible.git
Fix patterns typo, rebuild
parent
8fa2070074
commit
826c71fcb1
File diff suppressed because it is too large
Load Diff
@ -1,36 +1,92 @@
|
||||
.. _apt:
|
||||
|
||||
apt
|
||||
```
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.0.2
|
||||
|
||||
Manages apt-packages (such as for Debian/Ubuntu).
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| name | no | | A package name or package specifier with version, like `foo` or `foo=1.0` |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| state | no | present | 'absent', 'present', or 'latest'. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| update_cache | no | no | Run the equivalent of apt-get update before the operation. |
|
||||
| | | | Can be run as part of the package installation or a seperate step |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| purge | no | no | Will forge purge of configuration files if state is set to 'absent'. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| default_release | no | | Corresponds to the -t option for apt and sets pin priorities |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| install_recommends | no | yes | Corresponds to the --no-install-recommends option for apt, default |
|
||||
| | | | behavior works as apt's default behavior, 'no' does not install |
|
||||
| | | | recommended packages. Suggested packages are never installed. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| force | no | no | If 'yes', force installs/removes. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>purge</td>
|
||||
<td>no</td>
|
||||
<td>no</td>
|
||||
<td><ul><li>yes</li><li>no</li></ul></td>
|
||||
<td>Will force purging of configuration files if the module state is set to <code>absent</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>no</td>
|
||||
<td>present</td>
|
||||
<td><ul><li>installed</li><li>latest</li><li>remove</li><li>absent</li><li>present</li></ul></td>
|
||||
<td>Indicates the desired package state</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>force</td>
|
||||
<td>no</td>
|
||||
<td>no</td>
|
||||
<td><ul><li>yes</li><li>no</li></ul></td>
|
||||
<td>If <code>yes</code>, force installs/removes.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pkg</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>A package name or package specifier with version, like <code>foo</code> or <code>foo=1.0</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>update_cache</td>
|
||||
<td>no</td>
|
||||
<td>no</td>
|
||||
<td><ul><li>yes</li><li>no</li></ul></td>
|
||||
<td>Run the equivalent of <code>apt-get update</code> before the operation. Can be run as part of the package installation or as a seperate step</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>default_release</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Corresponds to the <code>-t</code> option for <em>apt</em> and sets pin priorities</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>install_recommends</td>
|
||||
<td>no</td>
|
||||
<td>no</td>
|
||||
<td><ul><li>yes</li><li>no</li></ul></td>
|
||||
<td>Corresponds to the <code>--no-install-recommends</code> option for <em>apt</em>, default behavior works as apt's default behavior, <code>no</code> does not install recommended packages. Suggested packages are never installed.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Update repositories cache and install <code>foo</code> package</p> <p><pre>
|
||||
apt pkg=foo update-cache=yes
|
||||
</pre></p>
|
||||
<p>Remove <code>foo</code> package</p> <p><pre>
|
||||
apt pkg=foo state=removed
|
||||
</pre></p>
|
||||
<p>Install the the package <code>foo</code></p> <p><pre>
|
||||
apt pkg=foo state=installed
|
||||
</pre></p>
|
||||
<p>Install the version '1.00' of package <code>foo</code></p> <p><pre>
|
||||
apt pkg=foo=1.00 state=installed
|
||||
</pre></p>
|
||||
<p>Update the repository cache and update package <code>ngnix</code> to latest version using default release <code>squeeze-backport</code></p> <p><pre>
|
||||
apt pkg=nginx state=latest default-release=squeeze-backports update-cache=yes
|
||||
</pre></p>
|
||||
<p>Install latest version of <code>openjdk-6-jdk</code> ignoring <code>install-recomands</code></p> <p><pre>
|
||||
apt pkg=openjdk-6-jdk state=latest install-recommends=no
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
|
@ -1,21 +1,51 @@
|
||||
.. _apt_repository:
|
||||
|
||||
apt_repository
|
||||
``````````````
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.7
|
||||
|
||||
Manages apt repositores
|
||||
Manages apt repositores (such as for Debian/Ubuntu).
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| repo | yes | | The repository name/value |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| state | no | present | 'absent' or 'present' |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
.. raw:: html
|
||||
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>repo</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The repository name/value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>no</td>
|
||||
<td>present</td>
|
||||
<td><ul><li>present</li><li>absent</li></ul></td>
|
||||
<td>The repository state</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
apt_repository repo=ppa:nginx/stable
|
||||
.. raw:: html
|
||||
|
||||
<p>Add nginx stable repository from PPA</p> <p><pre>
|
||||
apt_repository repo=ppa://nginx/stable
|
||||
</pre></p>
|
||||
<p>Add specified repository into sources.</p> <p><pre>
|
||||
apt_repository repo='deb http://archive.canonical.com/ubuntu hardy partner'
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<h4>Notes</h4>
|
||||
<p>This module works on Debian and Ubuntu only and requires <code>apt-add-repository</code> be available on destination server. To ensure this package is available use the <code>apt</code> module and install the <code>python-software-properties</code> package before using this module.</p>
|
||||
<p>A bug in <code>apt-add-repository</code> always adds <code>deb</code> and <code>deb-src</code> types for repositories (see the issue on Launchpad <a href='https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/987264'>https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/987264</a>), if a repo doesn't have source information (eg MongoDB repo from 10gen) the system will fail while updating repositories.</p>
|
||||
|
@ -1,31 +1,56 @@
|
||||
.. _assemble:
|
||||
|
||||
assemble
|
||||
````````
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.5
|
||||
|
||||
Assembles a configuration file from fragments. Often a particular
|
||||
program will take a single configuration file and does not support a
|
||||
conf.d style structure where it is easy to build up the configuration
|
||||
from multiple sources. Assemble will take a directory of files that
|
||||
have already been transferred to the system, and concatenate them
|
||||
together to produce a destination file. Files are assembled in string
|
||||
sorting order. Puppet calls this idea "fragments".
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| src | yes | | An already existing directory full of source files |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| dest | yes | | A file to create using the concatenation of all of the source files |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| backup | no | no | Create a backup file including the timestamp information so you can |
|
||||
| | | | get the original file back if you somehow clobbered it incorrectly. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| OTHERS | | | All arguments that the file module takes may also be used |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
Assembles a configuration file from fragments. Often a particular program will take a single configuration file and does not support a ``conf.d`` style structure where it is easy to build up the configuration from multiple sources. Assemble will take a directory of files that have already been transferred to the system, and concatenate them together to produce a destination file. Files are assembled in string sorting order. Puppet calls this idea *fragments*.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dest</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>A file to create using the concatenation of all of the source files.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>src</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>An already existing directory full of source files.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>backup</td>
|
||||
<td>no</td>
|
||||
<td>no</td>
|
||||
<td><ul><li>yes</li><li>no</li></ul></td>
|
||||
<td>Create a backup file (if <code>yes</code>), including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>others</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>all arguments accepted by the <span class='module'>file</span> module also work here</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Example from Ansible Playbooks</p> <p><pre>
|
||||
assemble src=/etc/someapp/fragments dest=/etc/someapp/someapp.conf
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
|
@ -0,0 +1,44 @@
|
||||
.. _async_status:
|
||||
|
||||
async_status
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.5
|
||||
|
||||
This module gets the status of an asynchronous task. See: http://ansible.cc/docs/playbooks2.html#asynchronous-actions-and-polling
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>jid</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Job or task identifier</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mode</td>
|
||||
<td>no</td>
|
||||
<td>status</td>
|
||||
<td><ul><li>status</li><li>cleanup</li></ul></td>
|
||||
<td>if <code>status</code>, obtain the status; if <code>cleanup</code>, clean up the async job cache located in <code>~/.ansible_async/</code> for the specified job <em>jid</em>.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<br/>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<h4>Notes</h4>
|
||||
<p>See <a href='http://ansible.cc/docs/playbooks2.html#asynchronous-actions-and-polling'>http://ansible.cc/docs/playbooks2.html#asynchronous-actions-and-polling</a></p>
|
||||
|
@ -1,22 +1,52 @@
|
||||
.. _authorized_key:
|
||||
|
||||
authorized_key
|
||||
``````````````
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.5
|
||||
|
||||
Adds or removes an authorized key for a user from a remote host.
|
||||
Adds or removes an SSH authorized key for a user from a remote host.
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| user | yes | | Name of the user who should have access to the remote host |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| key | yes | | the SSH public key, as a string |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| state | no | present | whether the given key should or should not be in the file |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
.. raw:: html
|
||||
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>no</td>
|
||||
<td>present</td>
|
||||
<td><ul><li>present</li><li>absent</li></ul></td>
|
||||
<td>whether the given key should or should not be in the file</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Name of the user who should have access to the remote host</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>key</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>the SSH public key, as a string</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Example from Ansible Playbooks</p> <p><pre>
|
||||
authorized_key user=charlie key="ssh-dss ASDF1234L+8BTwaRYr/rycsBF1D8e5pTxEsXHQs4iq+mZdyWqlW++L6pMiam1A8yweP+rKtgjK2httVS6GigVsuWWfOd7/sdWippefq74nppVUELHPKkaIOjJNN1zUHFoL/YMwAAAEBALnAsQN10TNGsRDe5arBsW8cTOjqLyYBcIqgPYTZW8zENErFxt7ij3fW3Jh/sCpnmy8rkS7FyK8ULX0PEy/2yDx8/5rXgMIICbRH/XaBy9Ud5bRBFVkEDu/r+rXP33wFPHjWjwvHAtfci1NRBAudQI/98DbcGQw5HmE89CjgZRo5ktkC5yu/8agEPocVjdHyZr7PaHfxZGUDGKtGRL2QzRYukCmWo1cZbMBHcI5FzImvTHS9/8B3SATjXMPgbfBuEeBwuBK5EjL+CtHY5bWs9kmYjmeo0KfUMH8hY4MAXDoKhQ7DhBPIrcjS5jPtoGxIREZjba67r6/P2XKXaCZH6Fc= charlie@example.org 2011-01-17"
|
||||
</pre></p>
|
||||
<p>Shorthand available in Ansible 0.8 and later</p> <p><pre>
|
||||
authorized_key user=charlie key=$FILE(/home/charlie/.ssh/id_rsa.pub)
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
|
@ -0,0 +1,42 @@
|
||||
.. _fail:
|
||||
|
||||
fail
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.8
|
||||
|
||||
This module fails the progress with a custom message. It can be useful for bailing out when a certain condition is met using only_if.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>msg</td>
|
||||
<td>no</td>
|
||||
<td>Failed because only_if condition is true</td>
|
||||
<td><ul></ul></td>
|
||||
<td>The customized message used for failing execution. If ommited, fail will simple bail out with a generic message.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>rc</td>
|
||||
<td>no</td>
|
||||
<td>1</td>
|
||||
<td><ul></ul></td>
|
||||
<td>The return code of the failure. This is currently not used by Ansible, but might be used in the future.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Example of how a playbook may fail when a condition is not met</p> <p><pre>
|
||||
[{'action': 'fail msg="The system may not be provisioned according to the CMDB status."', 'only_if': "'$cmdb_status' != 'to-be-staged'"}]
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
@ -1,22 +1,42 @@
|
||||
.. _fetch:
|
||||
|
||||
fetch
|
||||
`````
|
||||
``````````````````````````````
|
||||
|
||||
This module works like 'copy', but in reverse. It is used for fetching files
|
||||
from remote machines and storing them locally in a file tree, organized by hostname.
|
||||
.. versionadded:: 0.2
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| src | yes | | The file on the remote system to fetch. This needs to be a file, not |
|
||||
| | | | a directory. Recursive fetching may be supported in a later release. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| dest | yes | | A directory to save the file into. For example, if the 'dest' directory |
|
||||
| | | | is '/foo', a src file named '/tmp/bar' on host 'host.example.com', would |
|
||||
| | | | be saved into '/foo/host.example.com/tmp/bar' |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
This module works like ``copy``, but in reverse. It is used for fetching files from remote machines and storing them locally in a file tree, organized by hostname.
|
||||
|
||||
Example::
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dest</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>A directory to save the file into. For example, if the <em>dest</em> directory is <code>/backup</code> a src file named <code>/etc/profile</code> on host <code>host.example.com</code>, would be saved into <code>/backup/host.example.com/etc/profile</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>src</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The file on the remote system to fetch. This must be a file, not a directory. Recursive fetching may be supported in a later release.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Example from Ansible Playbooks</p> <p><pre>
|
||||
fetch src=/var/log/messages dest=/home/logtree
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
|
@ -0,0 +1,61 @@
|
||||
.. _fireball:
|
||||
|
||||
fireball
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.9
|
||||
|
||||
This modules launches an ephemeral *fireball* ZeroMQ message bus daemon on the remote node which Ansible can to communicate with nodes at high speed.
|
||||
The daemon listens on a configurable port for a configurable amount of time.
|
||||
Starting a new fireball as a given user terminates any existing user fireballs.
|
||||
Fireball mode is AES encrypted
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>minutes</td>
|
||||
<td>no</td>
|
||||
<td>30</td>
|
||||
<td><ul></ul></td>
|
||||
<td>The <em>fireball</em> listener daemon is started on nodes and will stay around for this number of minutes before turning itself off.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>port</td>
|
||||
<td>no</td>
|
||||
<td>5099</td>
|
||||
<td><ul></ul></td>
|
||||
<td>TCP port for ZeroMQ</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>This example playbook has two plays: the first launches <em>fireball</em> mode on all hosts via SSH, and the second actually starts using <em>fireball</em> node for subsequent management over the fireball interface</p> <p><pre>
|
||||
- hosts: devservers
|
||||
gather_facts: false
|
||||
connection: ssh
|
||||
sudo: yes
|
||||
tasks:
|
||||
- action: fireball
|
||||
|
||||
- hosts: devservers
|
||||
connection: fireball
|
||||
tasks:
|
||||
- action: command /usr/bin/anything
|
||||
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<h4>Notes</h4>
|
||||
<p>See the advanced playbooks chapter for more about using fireball mode.</p>
|
||||
|
@ -1,26 +1,63 @@
|
||||
.. _git:
|
||||
|
||||
git
|
||||
```
|
||||
|
||||
Deploys software (or files) from git checkouts.
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| repo | yes | | git, ssh, or http protocol address of the git repo |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| dest | yes | | absolute path of where the repo should be checked out to |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| version | no | HEAD | what version to check out -- either the git SHA, the literal string |
|
||||
| | | | 'HEAD', branch name, or a tag name. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| remote | no | origin | name of the remote branch |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| force | no | yes | (new in 0.7) If yes, any modified files in the working repository will be |
|
||||
| | | | discarded. Prior to 0.7, this was always 'yes' and could not be disabled. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.0.1
|
||||
|
||||
Manage git checkouts of repositories to deploy files or software.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>repo</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>git, ssh, or http protocol address of the git repository.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dest</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Absolute path of where the repository should be checked out to.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>version</td>
|
||||
<td>no</td>
|
||||
<td>HEAD</td>
|
||||
<td><ul></ul></td>
|
||||
<td>What version of the repository to check out. This can be the git <em>SHA</em>, the literal string <em>HEAD</em>, branch name, or a tag name.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>force</td>
|
||||
<td>no</td>
|
||||
<td>yes</td>
|
||||
<td><ul><li>True</li><li>False</li></ul></td>
|
||||
<td>(New in 0.7) If yes, any modified files in the working repository will be discarded. Prior to 0.7, this was always 'yes' and could not be disabled.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>remote</td>
|
||||
<td>no</td>
|
||||
<td>origin</td>
|
||||
<td><ul></ul></td>
|
||||
<td>Name of the remote branch.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Example git checkout from Ansible Playbooks</p> <p><pre>
|
||||
git repo=git://foosball.example.org/path/to/repo.git dest=/srv/checkout version=release-0.22
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
|
@ -1,24 +1,56 @@
|
||||
.. _group:
|
||||
|
||||
group
|
||||
`````
|
||||
``````````````````````````````
|
||||
|
||||
Adds or removes groups.
|
||||
.. versionadded:: 0.0.2
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| name | yes | | name of the group |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| gid | | | optional git to set for the group |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| state | | present | 'absent' or 'present' |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| system | | no | if 'yes', indicates that the group being created is a system group. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
Manage presence of groups on a host.
|
||||
|
||||
To control members of the group, see the users resource.
|
||||
.. raw:: html
|
||||
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>no</td>
|
||||
<td>present</td>
|
||||
<td><ul><li>present</li><li>absent</li></ul></td>
|
||||
<td>Whether the group should be present or not on the remote host.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>gid</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Optional <em>GID</em> to set for the group.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Name of the group to manage.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>system</td>
|
||||
<td>no</td>
|
||||
<td>no</td>
|
||||
<td><ul><li>True</li><li>False</li></ul></td>
|
||||
<td>If <em>yes</em>, indicates that the group created is a system group.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Example group command from Ansible Playbooks</p> <p><pre>
|
||||
group name=somegroup state=present
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
|
@ -1,28 +1,77 @@
|
||||
.. _mount:
|
||||
|
||||
mount
|
||||
`````
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.6
|
||||
|
||||
The mount module controls active and configured mount points (fstab).
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| name | yes | | path to the mountpoint, ex: /mnt/foo |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| src | yes | | device to be mounted |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| fstype | yes | | fstype |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| opts | no | | mount options (see fstab docs) |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| dump | no | | dump (see fstab docs) |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| passno | no | | passno (see fstab docs) |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| state | yes | | 'present', 'absent', 'mounted', or 'unmounted'. If mounted/unmounted, |
|
||||
| | | | the device will be actively mounted or unmounted as well as just |
|
||||
| | | | configured in fstab. 'absent', and 'present' only deal with fstab. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
This module controls active and configured mount points in ``/etc/fstab``.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>src</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>device to be mounted on <em>name</em>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul><li>present</li><li>absent</li><li>mounted</li><li>unmounted</li></ul></td>
|
||||
<td>If <code>mounted</code> or <code>unmounted</code>, the device will be actively mounted or unmounted as well as just configured in <em>fstab</em>. <code>absent</code> and <code>present</code> only deal with <em>fstab</em>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>path to the mount point, eg: <code>/mnt/files</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dump</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>dump (see fstab(8))</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>passno</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>passno (see fstab(8))</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>opts</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>mount options (see fstab(8))</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>fstype</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>file-system type</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Mount DVD read-only</p> <p><pre>
|
||||
mount name=/mnt/dvd src=/dev/sr0 fstype=iso9660 opts=ro
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
|
@ -1,38 +1,83 @@
|
||||
.. _mysql_db:
|
||||
|
||||
mysql_db
|
||||
````````
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.6
|
||||
|
||||
Add or remove MySQL databases from a remote host.
|
||||
|
||||
Requires the MySQLdb Python package on the remote host. For Ubuntu, this is as easy as
|
||||
apt-get install python-mysqldb.
|
||||
|
||||
+--------------------+----------+-----------+-----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+===========+=============================================================================+
|
||||
| name | yes | | name of the database to add or remove |
|
||||
+--------------------+----------+-----------+-----------------------------------------------------------------------------+
|
||||
| login_user | no | | user name used to authenticate with |
|
||||
+--------------------+----------+-----------+-----------------------------------------------------------------------------+
|
||||
| login_password | no | | password used to authenticate with |
|
||||
+--------------------+----------+-----------+-----------------------------------------------------------------------------+
|
||||
| login_host | no | localhost | host running the database |
|
||||
+--------------------+----------+-----------+-----------------------------------------------------------------------------+
|
||||
| state | no | present | 'absent' or 'present' |
|
||||
+--------------------+----------+-----------+-----------------------------------------------------------------------------+
|
||||
| collation | no | | collation mode |
|
||||
+--------------------+----------+-----------+-----------------------------------------------------------------------------+
|
||||
| encoding | no | | encoding mode |
|
||||
+--------------------+----------+-----------+-----------------------------------------------------------------------------+
|
||||
|
||||
Both 'login_password' and 'login_username' are required when you are passing credentials.
|
||||
If none are present, the module will attempt to read the credentials from ~/.my.cnf, and
|
||||
finally fall back to using the MySQL default login of 'root' with no password.
|
||||
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
|
||||
- name: Create database
|
||||
action: mysql_db db=bobdata state=present
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>no</td>
|
||||
<td>present</td>
|
||||
<td><ul><li>present</li><li>absent</li></ul></td>
|
||||
<td>The database state</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>name of the database to add or remove</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>encoding</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Encoding mode</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>collation</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Collation mode</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>login_user</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The username used to authenticate with</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>login_host</td>
|
||||
<td>no</td>
|
||||
<td>localhost</td>
|
||||
<td><ul></ul></td>
|
||||
<td>Host running the database</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>login_password</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The password used to authenticate with</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Create a new database with name 'bobdata'</p> <p><pre>
|
||||
mysql_db db=bobdata state=present
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<h4>Notes</h4>
|
||||
<p>Requires the MySQLdb Python package on the remote host. For Ubuntu, this is as easy as apt-get install python-mysqldb.</p>
|
||||
<p>Both <code>login_password</code> and <code>login_username</code> are required when you are passing credentials. If none are present, the module will attempt to read the credentials from <code>~/.my.cnf</code>, and finally fall back to using the MySQL default login of 'root' with no password.</p>
|
||||
|
@ -0,0 +1,57 @@
|
||||
.. _pause:
|
||||
|
||||
pause
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.8
|
||||
|
||||
Pauses playbook execution for a set amount of time, or until a prompt is acknowledged. All parameters are optional. The default behavior is to pause with a prompt.
|
||||
You can use ``ctrl+c`` if you wish to advance a pause earlier than it is set to expire or if you need to abort a playbook run entirely. To continue early: press ``ctrl+c`` and then ``c``. To abort a playbook: press ``ctrl+c`` and then ``a``.
|
||||
The pause module integrates into async/parallelized playbooks without any special considerations (see also: Rolling Updates). When using pauses with the ``serial`` playbook parameter (as in rolling updates) you are only prompted once for the current group of hosts.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>seconds</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Number of minutes to pause for.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>minutes</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Number of minutes to pause for.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>prompt</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Optional text to use for the prompt message.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Pause for 5 minutes to build app cache.</p> <p><pre>
|
||||
pause minutes=5
|
||||
</pre></p>
|
||||
<p>Pause until you can verify updates to an application were successful.</p> <p><pre>
|
||||
pause
|
||||
</pre></p>
|
||||
<p>A helpful reminder of what to look out for post-update.</p> <p><pre>
|
||||
pause prompt=Make sure org.foo.FooOverload exception is not present
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
@ -1,10 +1,16 @@
|
||||
.. _ping:
|
||||
|
||||
ping
|
||||
````
|
||||
``````````````````````````````
|
||||
|
||||
A trivial test module, this module always returns 'pong' on
|
||||
successful contact. It does not make sense in playbooks, but is useful
|
||||
from /usr/bin/ansible::
|
||||
|
||||
A trivial test module, this module always returns 'pong' on successful contact. It does not make sense in playbooks, but is useful from ``/usr/bin/ansible``
|
||||
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Test 'webservers' status</p> <p><pre>
|
||||
ansible webservers -m ping
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
|
@ -1,34 +1,80 @@
|
||||
.. _pip:
|
||||
|
||||
pip
|
||||
```
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.7
|
||||
|
||||
Manages Python library dependencies.
|
||||
Manage Python library dependencies.
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| name | no | | The name of a Python library to install |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| version | no | | The version number to install of the Python library specified in the |
|
||||
| | | | 'name' parameter |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| requirements | no | | The path to a pip requirements file |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| virtualenv | no | | An optional path to a virtualenv directory to install into |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| state | no | present | 'present', 'absent' or 'latest' |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
.. raw:: html
|
||||
|
||||
Please note that `virtualenv <http://www.virtualenv.org/>`_ must be installed on
|
||||
the remote host if the `virtualenv` parameter is specified.
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>virtualenv</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>An optional path to a virtualenv directory to install into</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>no</td>
|
||||
<td>present</td>
|
||||
<td><ul><li>present</li><li>absent</li><li>latest</li></ul></td>
|
||||
<td>The state of module</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>version</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The version number to install of the Python library specified in the 'name' parameter</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>requirements</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The path to a pip requirements file</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The name of a Python library to install</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Examples::
|
||||
.. raw:: html
|
||||
|
||||
<p>Install <em>flask</em> python package.</p> <p><pre>
|
||||
pip name=flask
|
||||
</pre></p>
|
||||
<p>Install <em>flask</em> python package on version 0.8.</p> <p><pre>
|
||||
pip name=flask version=0.8
|
||||
</pre></p>
|
||||
<p>Install <em>Flask</em> (<a href='http://flask.pocoo.org/'>http://flask.pocoo.org/</a>) into the specified <em>virtualenv</em></p> <p><pre>
|
||||
pip name=flask virtualenv=/srv/webapps/my_app/venv
|
||||
</pre></p>
|
||||
<p>Install specified python requirements.</p> <p><pre>
|
||||
pip requirements=/srv/webapps/my_app/src/requirements.txt
|
||||
</pre></p>
|
||||
<p>Install specified python requirements in indicated virtualenv.</p> <p><pre>
|
||||
pip requirements=/srv/webapps/my_app/src/requirements.txt virtualenv=/srv/webapps/my_app/venv
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<h4>Notes</h4>
|
||||
<p>Please note that <a href='http://www.virtualenv.org/, virtualenv'>http://www.virtualenv.org/, virtualenv</a> must be installed on the remote host if the virtualenv parameter is specified.</p>
|
||||
|
@ -1,39 +1,76 @@
|
||||
.. _postgresql_db:
|
||||
|
||||
postgresql_db
|
||||
`````````````
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.6
|
||||
|
||||
Add or remove PostgreSQL databases from a remote host.
|
||||
|
||||
The default authentication assumes that you are either logging in as or
|
||||
sudo'ing to the postgres account on the host.
|
||||
|
||||
This module uses psycopg2, a Python PostgreSQL database adapter. You must
|
||||
ensure that psycopg2 is installed on the host before using this module. If
|
||||
the remote host is the PostgreSQL server (which is the default case), then
|
||||
PostgreSQL must also be installed on the remote host. For Ubuntu-based systems,
|
||||
install the postgresql, libpq-dev, and python-psycopg2 packages on the remote
|
||||
host before using this module.
|
||||
|
||||
|
||||
+--------------------+----------+----------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+==========+============================================================================+
|
||||
| name | yes | | name of the database to add or remove |
|
||||
+--------------------+----------+----------+----------------------------------------------------------------------------+
|
||||
| login_user | no | postgres | user (role) used to authenticate with PostgreSQL |
|
||||
+--------------------+----------+----------+----------------------------------------------------------------------------+
|
||||
| login_password | no | | password used to authenticate with PostgreSQL |
|
||||
+--------------------+----------+----------+----------------------------------------------------------------------------+
|
||||
| login_host | no | | host running PostgreSQL. Default (blank) implies localhost |
|
||||
+--------------------+----------+----------+----------------------------------------------------------------------------+
|
||||
| owner | no | | name of the role to set as owner of the database |
|
||||
+--------------------+----------+----------+----------------------------------------------------------------------------+
|
||||
| state | | present | 'absent' or 'present' |
|
||||
+--------------------+----------+----------+----------------------------------------------------------------------------+
|
||||
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>no</td>
|
||||
<td>present</td>
|
||||
<td><ul><li>present</li><li>absent</li></ul></td>
|
||||
<td>The database state</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>name of the database to add or remove</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>login_password</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The password used to authenticate with</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>owner</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Name of the role to set as owner of the database</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>login_user</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The username used to authenticate with</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>login_host</td>
|
||||
<td>no</td>
|
||||
<td>localhost</td>
|
||||
<td><ul></ul></td>
|
||||
<td>Host running the database</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Create a new database with name 'acme'</p> <p><pre>
|
||||
postgresql_db db=acme
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<h4>Notes</h4>
|
||||
<p>The default authentication assumes that you are either logging in as or sudo'ing to the postgres account on the host.</p>
|
||||
<p>This module uses psycopg2, a Python PostgreSQL database adapter. You must ensure that psycopg2 is installed on the host before using this module. If the remote host is the PostgreSQL server (which is the default case), then PostgreSQL must also be installed on the remote host. For Ubuntu-based systems, install the postgresql, libpq-dev, and python-psycopg2 packages on the remote host before using this module.</p>
|
||||
|
@ -1,24 +1,54 @@
|
||||
.. _seboolean:
|
||||
|
||||
seboolean
|
||||
`````````
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.7
|
||||
|
||||
Toggles SELinux booleans.
|
||||
|
||||
+--------------------+----------+---------------------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=====================+============================================================================+
|
||||
| name | yes | | name of the boolean to configure |
|
||||
+--------------------+----------+---------------------+----------------------------------------------------------------------------+
|
||||
| persistent | no | no | set to 'yes' if the boolean setting should survive a reboot |
|
||||
+--------------------+----------+---------------------+----------------------------------------------------------------------------+
|
||||
| state | yes | | desired boolean value. 'true' or 'false'. |
|
||||
+--------------------+----------+---------------------+----------------------------------------------------------------------------+
|
||||
|
||||
Example from Ansible :doc:`playbooks`::
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul><li>true</li><li>false</li></ul></td>
|
||||
<td>Desired boolean value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Name of the boolean to configure</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>persistent</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul><li>yes</li><li>no</li></ul></td>
|
||||
<td>Set to 'yes' if the boolean setting should survive a reboot</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Set <em>httpd_can_network_connect</em> SELinux flag to <em>true</em> and <em>persistent</em></p> <p><pre>
|
||||
seboolean name=httpd_can_network_connect state=true persistent=yes
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<h4>Notes</h4>
|
||||
<p>Not tested on any debian based system</p>
|
||||
|
@ -1,25 +1,57 @@
|
||||
.. _selinux:
|
||||
|
||||
selinux
|
||||
```````
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.7
|
||||
|
||||
Configures the SELinux mode and policy. A reboot may be required after usage. Ansible will not issue this reboot but
|
||||
will let you know when it is required.
|
||||
Configures the SELinux mode and policy. A reboot may be required after usage. Ansible will not issue this reboot but will let you know when it is required.
|
||||
|
||||
+--------------------+----------+---------------------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=====================+============================================================================+
|
||||
| policy | yes | | name of the SELinux policy to use (example: 'targeted') |
|
||||
+--------------------+----------+---------------------+----------------------------------------------------------------------------+
|
||||
| state | yes | | the SELinux mode. 'enforcing', 'permissive', or 'disabled' |
|
||||
+--------------------+----------+---------------------+----------------------------------------------------------------------------+
|
||||
| conf | no | /etc/selinux/config | path to the SELinux configuration file, if non-standard |
|
||||
+--------------------+----------+---------------------+----------------------------------------------------------------------------+
|
||||
.. raw:: html
|
||||
|
||||
Example from Ansible :doc:`playbooks`::
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>policy</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>name of the SELinux policy to use (example: 'targeted')</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul><li>enforcing</li><li>permissive</li><li>disabled</li></ul></td>
|
||||
<td>The SELinux mode</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>conf</td>
|
||||
<td>no</td>
|
||||
<td>/etc/selinux/config</td>
|
||||
<td><ul></ul></td>
|
||||
<td>path to the SELinux configuration file, if non-standard</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p><pre>
|
||||
selinux policy=targeted state=enforcing
|
||||
</pre></p>
|
||||
<p><pre>
|
||||
selinux policy=targeted state=disabled
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<h4>Notes</h4>
|
||||
<p>Not tested on any debian based system</p>
|
||||
|
@ -1,32 +1,68 @@
|
||||
.. _service:
|
||||
|
||||
service
|
||||
```````
|
||||
|
||||
Controls services on remote machines.
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| name | yes | | name of the service |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| state | no | started | 'started', 'stopped', 'reloaded', or 'restarted'. Started/stopped are |
|
||||
| | | | idempotent actions that will not run commands unless neccessary. |
|
||||
| | | | 'restarted' will always bounce the service, 'reloaded' will always reload. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| pattern | no | | (new in 0.7) if the service does not respond to the status command, |
|
||||
| | | | name a substring to look for as would be found in the output of the 'ps' |
|
||||
| | | | command as a stand-in for a status result. If the string is found, the |
|
||||
| | | | service will be assumed to be running. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| enabled | no | | Whether the service should start on boot. Either 'yes' or 'no'. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
|
||||
Example actions from Ansible :doc:`playbooks`::
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.1
|
||||
|
||||
Controls services on remote hosts.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>pattern</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>If the service does not respond to the status command, name a substring to look for as would be found in the output of the <em>ps</em> command as a stand-in for a status result. If the string is found, the servie will be assumed to be running. (added in Ansible 0.7)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul><li>running</li><li>started</li><li>stopped</li><li>restarted</li><li>reloaded</li></ul></td>
|
||||
<td><em>started</em>, <em>stopped</em>, <em>reloaded</em>, <em>restarted</em>. <em>Started</em>/<em>stopped</em> are idempotent actions that will not run commands unless necessary. <em>restarted</em> will always bounce the service. <em>reloaded</em> will always reload.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>enabled</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul><li>yes</li><li>no</li></ul></td>
|
||||
<td>Whether the service should start on boot.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Name of the service.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Example action from Ansible Playbooks</p> <p><pre>
|
||||
service name=httpd state=started
|
||||
</pre></p>
|
||||
<p>Example action from Ansible Playbooks</p> <p><pre>
|
||||
service name=httpd state=stopped
|
||||
</pre></p>
|
||||
<p>Example action from Ansible Playbooks</p> <p><pre>
|
||||
service name=httpd state=restarted
|
||||
</pre></p>
|
||||
<p>Example action from Ansible Playbooks</p> <p><pre>
|
||||
service name=httpd state=reloaded
|
||||
</pre></p>
|
||||
<p>Example action from Ansible Playbooks</p> <p><pre>
|
||||
service name=foo pattern=/usr/bin/foo state=started
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
|
@ -1,31 +1,54 @@
|
||||
.. _shell:
|
||||
|
||||
shell
|
||||
`````
|
||||
``````````````````````````````
|
||||
|
||||
The shell module takes the command name followed by a list of
|
||||
arguments, space delimited. It is almost exactly like the command module
|
||||
but runs the command through the user's configured shell on the remote node.
|
||||
.. versionadded:: 0.2
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| (free form) | N/A | N/A | the command module takes a free form command to run |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| creates | no | | a filename, when it already exists, this step will NOT be run |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| chdir | no | | cd into this directory before running the command (0.6 and later) |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
The shell module takes the command name followed by a list of arguments, space delimited. It is almost exactly like the ``command`` module but runs the command through the user's configured shell on the remote node.
|
||||
|
||||
The given command will be executed on all selected nodes.
|
||||
.. raw:: html
|
||||
|
||||
.. note::
|
||||
If you want to execute a command securely and predicably, it may be
|
||||
better to use the 'command' module instead. Best practices when
|
||||
writing playbooks will follow the trend of using 'command' unless
|
||||
'shell' is explicitly required. When running ad-hoc commands, use
|
||||
your best judgement.
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>creates</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>a filename, when it already exists, this step will NOT be run</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>chdir</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>cd into this directory before running the command (0.6 and later)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>(free form)</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The command module takes a free form command to run</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Example action from a playbook::
|
||||
.. raw:: html
|
||||
|
||||
<p>Execute the command in remote shell</p> <p><pre>
|
||||
shell somescript.sh >> somelog.txt
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<h4>Notes</h4>
|
||||
<p>If you want to execute a command securely and predicably, it may be better to use the <span class='module'>command</span> module instead. Best practices when writing playbooks will follow the trend of using <span class='module'>command</span> unless <span class='module'>shell</span> is explicitly required. When running ad-hoc commands, use your best judgement.</p>
|
||||
|
@ -0,0 +1,44 @@
|
||||
.. _slurp:
|
||||
|
||||
slurp
|
||||
``````````````````````````````
|
||||
|
||||
|
||||
This module works like ``fetch``. It is used for fetching a base64- encoded blob containing the data in a remote file.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>src</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The file on the remote system to fetch. This must be a file, not a directory.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Example using <code>/usr/bin/ansible</code></p> <p><pre>
|
||||
ansible host -m slurp -a 'src=/tmp/xx'
|
||||
host | success >> {
|
||||
"content": "aGVsbG8gQW5zaWJsZSB3b3JsZAo=",
|
||||
"encoding": "base64"
|
||||
}
|
||||
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<h4>Notes</h4>
|
||||
<p>See also: <span class='module'>fetch</span></p>
|
||||
|
@ -1,23 +1,54 @@
|
||||
.. _subversion:
|
||||
|
||||
subversion
|
||||
``````````
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.7
|
||||
|
||||
Deploys a subversion repository.
|
||||
This module is really simple, so for now this checks out from the given branch of a repo at a particular SHA or tag. Latest is not supported, you should not be doing that.
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| repo | yes | | The subversion URL to the repository. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| dest | yes | | Absolute path where the repository should be deployed. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| force | no | yes | If yes, any modified files in the working repository will be |
|
||||
| | | | discarded. If no, this module will fail if it encounters modified files. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
.. raw:: html
|
||||
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>repo</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The subversion URL to the repository.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dest</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Absolute path where the repository should be deployed.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>force</td>
|
||||
<td>no</td>
|
||||
<td>True</td>
|
||||
<td><ul><li>yes</li><li>no</li></ul></td>
|
||||
<td>If yes, any modified files in the working repository will be discarded. If no, this module will fail if it encounters modified files.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Export subversion repository in a specified folder</p> <p><pre>
|
||||
subversion repo=svn+ssh://an.example.org/path/to/repo dest=/src/checkout
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<h4>Notes</h4>
|
||||
<p>Requires subversion and grep on the client.</p>
|
||||
|
@ -1,20 +1,42 @@
|
||||
.. _supervisorctl:
|
||||
|
||||
supervisorctl
|
||||
`````````````
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.7
|
||||
|
||||
Manage the state of a program or group of programs running via Supervisord
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| name | yes | | The name of the supervisord program/process to manage |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| state | yes | | 'started', 'stopped' or 'restarted' |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
.. raw:: html
|
||||
|
||||
Example action from a playbook::
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul><li>started</li><li>stopped</li><li>restarted</li></ul></td>
|
||||
<td>The state of service</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>The name of the supervisord program/process to manage</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Manage the state of program <em>my_app</em> to be in <em>started</em> state.</p> <p><pre>
|
||||
supervisorctl name=my_app state=started
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
|
@ -1,29 +1,60 @@
|
||||
.. _template:
|
||||
|
||||
template
|
||||
````````
|
||||
|
||||
Templates a file out to a remote server.
|
||||
|
||||
Templates are processed by the
|
||||
`Jinja2 templating language <http://jinja.pocoo.org/docs/>`_ -
|
||||
documentation on the template formatting can be found in the
|
||||
`Template Designer Documentation <http://jinja.pocoo.org/docs/templates/>`_
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| src | yes | | Path of a Jinja2 formatted template on the local server. This can be |
|
||||
| | | | a relative or absolute path. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| dest | yes | | Location to render the template on the remote server |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| backup | no | no | Create a backup file including the timestamp information so you can |
|
||||
| | | | get the original file back if you somehow clobbered it incorrectly. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| OTHERS | | | This module also supports all of the arguments to the file module |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
|
||||
Example action from a playbook::
|
||||
|
||||
template src=/srv/mytemplates/foo.j2 dest=/etc/foo.conf owner=foo group=foo mode=0644
|
||||
``````````````````````````````
|
||||
|
||||
|
||||
Templates are processed by the Jinja2 templating language (http://jinja.pocoo.org/docs/) - documentation on the template formatting can be found in the Template Designer Documentation (http://jinja.pocoo.org/docs/templates/).
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dest</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Location to render the template to on the remote machine.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>src</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Path of a Jinja2 formatted template on the local server. This can be a relative or absolute path.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>backup</td>
|
||||
<td>no</td>
|
||||
<td>no</td>
|
||||
<td><ul><li>yes</li><li>no</li></ul></td>
|
||||
<td>Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>others</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>all arguments accepted by the <span class='module'>file</span> module also work here</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Example from Ansible Playbooks</p> <p><pre>
|
||||
template src=/mytemplates/foo.j2 dest=/etc/file.conf owner=bin group=wheel mode=0644
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<h4>Notes</h4>
|
||||
<p>Since Ansible version 0.9, templates are loaded with <code>trim_blocks=True</code>.</p>
|
||||
|
@ -1,47 +1,123 @@
|
||||
.. _user:
|
||||
|
||||
user
|
||||
````
|
||||
|
||||
Creates user accounts, manipulates existing user accounts, and removes user accounts.
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| name | yes | | name of the user to create, remove, or edit |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| comment | | | optionally sets the description of the user |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| uid | | | optionally sets the uid of the user |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| group | | | optionally sets the user's primary group (takes a group name) |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| groups | | | puts the user in this comma-delimited list of groups |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| append | | no | if 'yes', will only add groups, not set them to just the list in 'groups' |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| shell | | | optionally set the user's shell |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| createhome | | yes | unless 'no', a home directory will be made for the user |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| home | | | sets where the user's homedir should be, if not the default |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| password | | | optionally set the user's password to this crypted value. See the user's |
|
||||
| | | | example in the github examples directory for what this looks like in a |
|
||||
| | | | playbook |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| state | | present | when 'absent', removes the user. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| system | | no | only when initially creating, setting this to 'yes' makes the user a |
|
||||
| | | | system account. This setting cannot be changed on existing users. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| force | | no | when used with state=absent, behavior is as with userdel --force |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| remove | | no | when used with state=absent, behavior is as with userdel --remove |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
|
||||
user name=mdehaan comment=awesome password=awWxVV.JvmdHw createhome=yes
|
||||
user name=mdehaan groups=wheel,skynet
|
||||
user name=mdehaan state=absent force=yes
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.2
|
||||
|
||||
Manage user accounts and user attributes.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>comment</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Optionally sets the description (aka <em>GECOS</em>) of user account.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>shell</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Optionally set the user's shell.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>force</td>
|
||||
<td>no</td>
|
||||
<td>no</td>
|
||||
<td><ul><li>True</li><li>False</li></ul></td>
|
||||
<td>When used with <em>state=absent</em>, behavior is as with <em>userdel --force</em>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Name of the user to create, remove or modify.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>createhome</td>
|
||||
<td>no</td>
|
||||
<td>yes</td>
|
||||
<td><ul><li>True</li><li>False</li></ul></td>
|
||||
<td>Unless set to <em>no</em>, a home directory will be made for the user when the account is created.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>system</td>
|
||||
<td>no</td>
|
||||
<td>no</td>
|
||||
<td><ul><li>True</li><li>False</li></ul></td>
|
||||
<td>When creating an account, setting this to <em>yes</em> makes the user a system account. This setting cannot be changed on existing users.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>remove</td>
|
||||
<td>no</td>
|
||||
<td>no</td>
|
||||
<td><ul><li>True</li><li>False</li></ul></td>
|
||||
<td>When used with <em>state=absent</em>, behavior is as with <em>userdel --remove</em>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>no</td>
|
||||
<td>present</td>
|
||||
<td><ul><li>present</li><li>absent</li></ul></td>
|
||||
<td>Whether the account should exist. When <em>absent</em>, removes the user account.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>groups</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Puts the user in this comma-delimited list of groups.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>home</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Optionally set the user's home directory.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>group</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Optionally sets the user's primary group (takes a group name).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>password</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Optionally set the user's password to this crypted value. See the user example in the github examples directory for what this looks like in a playbook.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>append</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>If <em>yes</em>, will only add groups, not set them to just the list in <em>groups</em>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>uid</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>Optionally sets the <em>UID</em> of the user.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<br/>
|
||||
|
||||
|
@ -1,32 +1,63 @@
|
||||
.. _wait_for:
|
||||
|
||||
wait_for
|
||||
````````
|
||||
``````````````````````````````
|
||||
|
||||
.. versionadded:: 0.7
|
||||
|
||||
Waits for a given port to become accessible (or inaccessible) on a local or remote server.
|
||||
|
||||
This is useful for when services are not immediately available after their init scripts return -- which is true of certain
|
||||
Java application servers. It is also useful when starting guests with the virt module and
|
||||
needing to pause until they are ready.
|
||||
|
||||
+--------------------+----------+-----------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+===========+============================================================================+
|
||||
| host | no | 127.0.0.1 | hostname or IP to wait for |
|
||||
+--------------------+----------+-----------+----------------------------------------------------------------------------+
|
||||
| timeout | no | 300 | maximum number of seconds to wait |
|
||||
+--------------------+----------+-----------+----------------------------------------------------------------------------+
|
||||
| delay | no | 0 | number of seconds to wait before starting to poll |
|
||||
+--------------------+----------+-----------+----------------------------------------------------------------------------+
|
||||
| port | yes | | port to poll for openness or closedness |
|
||||
+--------------------+----------+-----------+----------------------------------------------------------------------------+
|
||||
| state | no | started | either 'started', or 'stopped' depending on whether the module should poll |
|
||||
| | | | for the port being open or closed. |
|
||||
+--------------------+----------+-----------+----------------------------------------------------------------------------+
|
||||
|
||||
Example from Ansible :doc:`playbooks`::
|
||||
|
||||
wait_for port=8080 delay=10
|
||||
This is useful for when services are not immediately available after their init scripts return - which is true of certain Java application servers. It is also useful when starting guests with the ``virt`` module and needing to pause until they are ready.
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>delay</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>number of seconds to wait before starting to poll</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>host</td>
|
||||
<td>no</td>
|
||||
<td>127.0.0.1</td>
|
||||
<td><ul></ul></td>
|
||||
<td>hostname or IP address to wait for</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>port</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>port number to poll</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>timeout</td>
|
||||
<td>no</td>
|
||||
<td>300</td>
|
||||
<td><ul></ul></td>
|
||||
<td>maximum number of seconds to wait for</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>no</td>
|
||||
<td>started</td>
|
||||
<td><ul><li>started</li><li>stopped</li></ul></td>
|
||||
<td>either <code>started</code>, or <code>stopped</code> depending on whether the module should poll for the port being open or closed.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p>Example from Ansible Playbooks</p> <p><pre>
|
||||
wait_for port=8000 delay=10
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
|
@ -1,23 +1,54 @@
|
||||
.. _yum:
|
||||
|
||||
yum
|
||||
```
|
||||
``````````````````````````````
|
||||
|
||||
Will install, upgrade, remove, and list packages with the yum package manager.
|
||||
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| parameter | required | default | comments |
|
||||
+====================+==========+=========+============================================================================+
|
||||
| name | yes | | package name, or package specifier with version, like 'name-1.0' |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| state | | present | 'present', 'latest', or 'absent'. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
| list | | | various non-idempotent commands for usage with /usr/bin/ansible and not |
|
||||
| | | | playbooks. See examples below. |
|
||||
+--------------------+----------+---------+----------------------------------------------------------------------------+
|
||||
Will install, upgrade, remove, and list packages with the *yum* package manager.
|
||||
|
||||
Example action from Ansible :doc:`playbooks`::
|
||||
.. raw:: html
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th class="head">parameter</th>
|
||||
<th class="head">required</th>
|
||||
<th class="head">default</th>
|
||||
<th class="head">choices</th>
|
||||
<th class="head">comments</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>state</td>
|
||||
<td>no</td>
|
||||
<td>present</td>
|
||||
<td><ul><li>present</li><li>latest</li><li>absent</li></ul></td>
|
||||
<td>whether to install (<code>present</code>, <code>latest</code>), or remove (<code>absent</code>) a package.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>list</td>
|
||||
<td>no</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>various non-idempotent commands for usage with <code>/usr/bin/ansible</code> and <em>not</em> playbooks. See examples.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>name</td>
|
||||
<td>yes</td>
|
||||
<td></td>
|
||||
<td><ul></ul></td>
|
||||
<td>package name, or package specifier with version, like <code>name-1.0</code>.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<p><pre>
|
||||
yum name=httpd state=latest
|
||||
</pre></p>
|
||||
<p><pre>
|
||||
yum name=httpd state=removed
|
||||
</pre></p>
|
||||
<p><pre>
|
||||
yum name=httpd state=installed
|
||||
</pre></p>
|
||||
<br/>
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue