Update module docs to include new user/group control features, fix formatting on playbooks page.

This commit is contained in:
Michael DeHaan 2012-03-31 12:08:28 -04:00
parent 8d92efa9fc
commit a879278713
8 changed files with 97 additions and 24 deletions

View file

@ -191,7 +191,7 @@ will remain short &amp; simple, and the source will be blindingly obvious.</p>
<p>We&#8217;ve learned well from &#8220;Infrastructure is Code&#8221;. Infrastructure should be easy and powerful to command, but it should not look like code, lest it acquire the disadvantages of a software project &#8211; bugs, complexity, and overhead. Infrastructure configurations should be simple, easy to develop, and easy to audit.</p>
<div class="section" id="architecture">
<h2>Architecture<a class="headerlink" href="#architecture" title="Permalink to this headline"></a></h2>
<img alt="&quot;Architecture Diagram&quot;" src="http://ansible.github.com/ansible_arch2.jpg" style="width: 800px;" />
<div align="center" class="align-center"><img alt="&quot;Architecture Diagram&quot;" class="align-center" src="http://ansible.github.com/ansible_arch2.jpg" style="width: 800px;" /></div>
</div>
<div class="section" id="features">
<h2>Features<a class="headerlink" href="#features" title="Permalink to this headline"></a></h2>
@ -270,6 +270,7 @@ Email: <input type=text name=email>&nbsp;&nbsp;<input type=submit name="sub" val
<li class="toctree-l2"><a class="reference internal" href="modules.html#facter">facter</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#file">file</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#git">git</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#group">group</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#ohai">ohai</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#ping">ping</a></li>
<li class="toctree-l2"><a class="reference internal" href="modules.html#service">service</a></li>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible-playbook</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible-playbook" lang="en"><a id="id559301"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible-playbook — run an ansible playbook</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible-playbook &lt;filename.yml&gt; … [options]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible playbooks</strong></span> are a configuration and multinode deployment
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible-playbook</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible-playbook" lang="en"><a id="id411675"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible-playbook — run an ansible playbook</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible-playbook &lt;filename.yml&gt; … [options]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible playbooks</strong></span> are a configuration and multinode deployment
system. Ansible-playbook is the tool used to run them. See the
project home page (link below) for more information.</p></div><div class="refsect1" title="ARGUMENTS"><a id="_arguments"></a><h2>ARGUMENTS</h2><div class="variablelist"><dl><dt><span class="term">
<span class="strong"><strong>filename.yml</strong></span>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible" lang="en"><a id="id377166"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible — run a command somewhere else</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible &lt;host-pattern&gt; [-f forks] [-m module_name] [-a args]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible</strong></span> is an extra-simple tool/framework/API for doing 'remote things' over
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ansible</title><link rel="stylesheet" href="./docbook-xsl.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div xml:lang="en" class="refentry" title="ansible" lang="en"><a id="id351566"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ansible — run a command somewhere else</p></div><div class="refsynopsisdiv" title="Synopsis"><a id="_synopsis"></a><h2>Synopsis</h2><p>ansible &lt;host-pattern&gt; [-f forks] [-m module_name] [-a args]</p></div><div class="refsect1" title="DESCRIPTION"><a id="_description"></a><h2>DESCRIPTION</h2><p><span class="strong"><strong>Ansible</strong></span> is an extra-simple tool/framework/API for doing 'remote things' over
SSH.</p></div><div class="refsect1" title="ARGUMENTS"><a id="_arguments"></a><h2>ARGUMENTS</h2><div class="variablelist"><dl><dt><span class="term">
<span class="strong"><strong>host-pattern</strong></span>
</span></dt><dd>

View file

@ -135,6 +135,7 @@ s.parentNode.insertBefore(ga, s);
<li><a class="reference internal" href="#facter">facter</a></li>
<li><a class="reference internal" href="#file">file</a></li>
<li><a class="reference internal" href="#git">git</a></li>
<li><a class="reference internal" href="#group">group</a></li>
<li><a class="reference internal" href="#ohai">ohai</a></li>
<li><a class="reference internal" href="#ping">ping</a></li>
<li><a class="reference internal" href="#service">service</a></li>
@ -310,6 +311,26 @@ file dest/path/to/delete state=absent</pre>
<div class="highlight-python"><pre>git repo=git://foosball.example.org/path/to/repo.git dest=/srv/checkout version=release-0.22</pre>
</div>
</div>
<div class="section" id="group">
<h2>group<a class="headerlink" href="#group" title="Permalink to this headline"></a></h2>
<p>Adds or removes groups.</p>
<p><em>name</em>:</p>
<ul class="simple">
<li>name of the group</li>
</ul>
<p><em>gid</em>:</p>
<ul class="simple">
<li>optional gid to set for the group</li>
</ul>
<p><em>state</em>:</p>
<ul class="simple">
<li>either &#8216;absent&#8217;, or &#8216;present&#8217;. &#8216;present&#8217; is the default.</li>
</ul>
<p>To control members of the group, see the users resource.</p>
<p>Example action from Ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
<div class="highlight-python"><pre>group name=somegroup state=present</pre>
</div>
</div>
<div class="section" id="ohai">
<h2>ohai<a class="headerlink" href="#ohai" title="Permalink to this headline"></a></h2>
<p>Similar to the <a class="reference internal" href="#facter"><em>facter</em></a> module, this returns JSON inventory data.
@ -427,6 +448,14 @@ be a relative or absolute path.</li>
<ul class="simple">
<li>Optionally sets the user&#8217;s primary group, takes a group name.</li>
</ul>
<p><em>groups</em>:</p>
<ul class="simple">
<li>Put the user in the specified groups, takes comma delimited group names.</li>
</ul>
<p><em>append</em>:</p>
<ul class="simple">
<li>If true, will only add additional groups to the user listed in &#8216;groups&#8217;, rather than making the user only be in those specified groups.</li>
</ul>
<p><em>shell</em>:</p>
<ul class="simple">
<li>Optionally sets the user&#8217;s shell.</li>
@ -437,16 +466,24 @@ be a relative or absolute path.</li>
</ul>
<p><em>password</em>:</p>
<ul class="simple">
<li>Sets the user&#8217;s password to this crypted value. Pass in a result from crypt. See the users
example in the github examples directory for what this looks like in a playbook.</li>
<li>Sets the user&#8217;s password to this crypted value. Pass in a result from crypt. See the users example in the github examples directory for what this looks like in a playbook.</li>
</ul>
<p><em>state</em>:</p>
<ul class="simple">
<li>Defaults to &#8216;present&#8217;. When &#8216;absent&#8217;, the user account will be removed if present.</li>
<li>Defaults to &#8216;present&#8217;. When &#8216;absent&#8217;, the user account will be removed if present. Optionally additional removal behaviors can be set with the &#8216;force&#8217; or &#8216;remove&#8217; parameter values (see below).</li>
</ul>
<p><em>force</em>:</p>
<ul class="simple">
<li>When used with a state of &#8216;absent&#8217;, the behavior denoted in the &#8216;userdel&#8217; manpage for &#8211;force is also used when removing the user. Value is &#8216;yes&#8217; or &#8216;no&#8217;, default is &#8216;no&#8217;.</li>
</ul>
<p><em>remove</em>:</p>
<ul class="simple">
<li>When used with a state of &#8216;absent&#8217;, the behavior denoted in the &#8216;userdel&#8217; manpage for &#8211;remove is also used when removing the user. Value is &#8216;yes&#8217; or &#8216;no&#8217;, default is &#8216;no&#8217;.</li>
</ul>
<p>Example action from Ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
<div class="highlight-python"><pre>user name=mdehaan comment=awesome passwd=awWxVV.JvmdHw createhome=yes
user name=mdehaan state=absent</pre>
user name=mdehaan groups=wheel,skynet
user name=mdehaan state=absent force=yes</pre>
</div>
</div>
<div class="section" id="yum">

View file

@ -232,15 +232,12 @@ documentation. The <cite>user</cite> is just the name of the user account:</p>
- hosts: webservers
user: root</pre>
</div>
<p>Support for running things from sudo is also available. Sudo must be
configured to not require a password.</p>
<blockquote>
<div><p>&#8212;
- hosts: webservers</p>
<blockquote>
<div>user: yourname
sudo: True</div></blockquote>
</div></blockquote>
<p>Support for running things from sudo is also available:</p>
<div class="highlight-python"><pre>---
- hosts: webservers
user: yourname
sudo: True</pre>
</div>
</div>
<div class="section" id="vars-section">
<h3>Vars section<a class="headerlink" href="#vars-section" title="Permalink to this headline"></a></h3>

View file

@ -177,6 +177,29 @@ Example action from Ansible :doc:`playbooks`::
git repo=git://foosball.example.org/path/to/repo.git dest=/srv/checkout version=release-0.22
group
`````
Adds or removes groups.
*name*:
* name of the group
*gid*:
* optional gid to set for the group
*state*:
* either 'absent', or 'present'. 'present' is the default.
To control members of the group, see the users resource.
Example action from Ansible :doc:`playbooks`::
group name=somegroup state=present
ohai
````
@ -327,6 +350,14 @@ Creates user accounts, manipulates existing user accounts, and removes user acco
* Optionally sets the user's primary group, takes a group name.
*groups*:
* Put the user in the specified groups, takes comma delimited group names.
*append*:
* If true, will only add additional groups to the user listed in 'groups', rather than making the user only be in those specified groups.
*shell*:
* Optionally sets the user's shell.
@ -337,17 +368,25 @@ Creates user accounts, manipulates existing user accounts, and removes user acco
*password*:
* Sets the user's password to this crypted value. Pass in a result from crypt. See the users
example in the github examples directory for what this looks like in a playbook.
* Sets the user's password to this crypted value. Pass in a result from crypt. See the users example in the github examples directory for what this looks like in a playbook.
*state*:
* Defaults to 'present'. When 'absent', the user account will be removed if present.
* Defaults to 'present'. When 'absent', the user account will be removed if present. Optionally additional removal behaviors can be set with the 'force' or 'remove' parameter values (see below).
*force*:
* When used with a state of 'absent', the behavior denoted in the 'userdel' manpage for --force is also used when removing the user. Value is 'yes' or 'no', default is 'no'.
*remove*:
* When used with a state of 'absent', the behavior denoted in the 'userdel' manpage for --remove is also used when removing the user. Value is 'yes' or 'no', default is 'no'.
Example action from Ansible :doc:`playbooks`::
user name=mdehaan comment=awesome passwd=awWxVV.JvmdHw createhome=yes
user name=mdehaan state=absent
user name=mdehaan groups=wheel,skynet
user name=mdehaan state=absent force=yes
.. _yum:

View file

@ -73,9 +73,8 @@ documentation. The `user` is just the name of the user account::
user: root
Support for running things from sudo is also available. Sudo must be
configured to not require a password.
Support for running things from sudo is also available::
---
- hosts: webservers
user: yourname

File diff suppressed because one or more lines are too long