<spanid="id14"></span><h2><aclass="toc-backref"href="#contents">lineinfile</a><aclass="headerlink"href="#lineinfile"title="Permalink to this headline">¶</a></h2>
<p>This module will search a file for a line, and ensure that it is present or
absent.</p>
<p>This is primarily useful when you only want to change a single line in a file.
For other cases, see the copy or template modules.</p>
<tableborder="1"class="docutils">
<colgroup>
<colwidth="17%"/>
<colwidth="9%"/>
<colwidth="8%"/>
<colwidth="66%"/>
</colgroup>
<theadvalign="bottom">
<trclass="row-odd"><thclass="head">parameter</th>
<thclass="head">required</th>
<thclass="head">default</th>
<thclass="head">comments</th>
</tr>
</thead>
<tbodyvalign="top">
<trclass="row-even"><td>state</td>
<td>no</td>
<td>present</td>
<td>‘absent’ or ‘present’</td>
</tr>
<trclass="row-odd"><td>name</td>
<td>yes</td>
<td> </td>
<td>The file to modify.</td>
</tr>
<trclass="row-even"><td>regexp</td>
<td>yes</td>
<td> </td>
<td>The regular expression to look for in the file. For state=present, the
pattern to replace. For state=absent, the pattern of the line to
remove.</td>
</tr>
<trclass="row-odd"><td>line</td>
<td>maybe</td>
<td> </td>
<td>Required for state=present. The line to insert/replace into the file. Must
match the value given to ‘regexp’.</td>
</tr>
<trclass="row-even"><td>insertafter</td>
<td>no</td>
<td>EOF</td>
<td>Used with state=present. If specified, the line will be inserted after the
specified regular expression. Two special values are available: BOF for
inserting the line at the beginning of the file, and EOF for inserting the
<spanid="id14"></span><h2><aclass="toc-backref"href="#contents">mount</a><aclass="headerlink"href="#mount"title="Permalink to this headline">¶</a></h2>
<spanid="id15"></span><h2><aclass="toc-backref"href="#contents">mount</a><aclass="headerlink"href="#mount"title="Permalink to this headline">¶</a></h2>
<pclass="versionadded">
<spanclass="versionmodified">New in version 0.6.</span></p>
<p>The mount module controls active and configured mount points (fstab).</p>
@ -974,7 +1037,7 @@ configured in fstab. ‘absent’, and ‘present’ only deal
</table>
</div>
<divclass="section"id="mysql-db">
<spanid="id15"></span><h2><aclass="toc-backref"href="#contents">mysql_db</a><aclass="headerlink"href="#mysql-db"title="Permalink to this headline">¶</a></h2>
<spanid="id16"></span><h2><aclass="toc-backref"href="#contents">mysql_db</a><aclass="headerlink"href="#mysql-db"title="Permalink to this headline">¶</a></h2>
<pclass="versionadded">
<spanclass="versionmodified">New in version 0.6.</span></p>
<p>Add or remove MySQL databases from a remote host.</p>
@ -1041,7 +1104,7 @@ finally fall back to using the MySQL default login of ‘root’ with no
</div>
</div>
<divclass="section"id="mysql-user">
<spanid="id16"></span><h2><aclass="toc-backref"href="#contents">mysql_user</a><aclass="headerlink"href="#mysql-user"title="Permalink to this headline">¶</a></h2>
<spanid="id17"></span><h2><aclass="toc-backref"href="#contents">mysql_user</a><aclass="headerlink"href="#mysql-user"title="Permalink to this headline">¶</a></h2>
<pclass="versionadded">
<spanclass="versionmodified">New in version 0.6.</span></p>
<p>Adds or removes a user from a MySQL database.</p>
@ -1119,7 +1182,7 @@ finally fall back to using the MySQL default login of ‘root’ with no
</div>
</div>
<divclass="section"id="nagios">
<spanid="id17"></span><h2><aclass="toc-backref"href="#contents">nagios</a><aclass="headerlink"href="#nagios"title="Permalink to this headline">¶</a></h2>
<spanid="id18"></span><h2><aclass="toc-backref"href="#contents">nagios</a><aclass="headerlink"href="#nagios"title="Permalink to this headline">¶</a></h2>
<pclass="versionadded">
<spanclass="versionmodified">New in version 0.7.</span></p>
<p>Perform common tasks in Nagios related to downtime and notifications.</p>
@ -1291,7 +1354,7 @@ receive this error if that is the case:</p>
</ol>
</div>
<divclass="section"id="ohai">
<spanid="id18"></span><h2><aclass="toc-backref"href="#contents">ohai</a><aclass="headerlink"href="#ohai"title="Permalink to this headline">¶</a></h2>
<spanid="id19"></span><h2><aclass="toc-backref"href="#contents">ohai</a><aclass="headerlink"href="#ohai"title="Permalink to this headline">¶</a></h2>
<p>Similar to the <aclass="reference internal"href="#facter"><em>facter</em></a> module, this returns JSON inventory data.
Ohai data is a bit more verbose and nested than facter.</p>
<p>Requires that ‘ohai’ be installed on the remote end.</p>
@ -1302,7 +1365,7 @@ Ohai data is a bit more verbose and nested than facter.</p>
</div>
</div>
<divclass="section"id="ping">
<spanid="id19"></span><h2><aclass="toc-backref"href="#contents">ping</a><aclass="headerlink"href="#ping"title="Permalink to this headline">¶</a></h2>
<spanid="id20"></span><h2><aclass="toc-backref"href="#contents">ping</a><aclass="headerlink"href="#ping"title="Permalink to this headline">¶</a></h2>
<p>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:</p>
@ -1310,7 +1373,7 @@ from /usr/bin/ansible:</p>
</div>
</div>
<divclass="section"id="pip">
<spanid="id20"></span><h2><aclass="toc-backref"href="#contents">pip</a><aclass="headerlink"href="#pip"title="Permalink to this headline">¶</a></h2>
<spanid="id21"></span><h2><aclass="toc-backref"href="#contents">pip</a><aclass="headerlink"href="#pip"title="Permalink to this headline">¶</a></h2>
<pclass="versionadded">
<spanclass="versionmodified">New in version 0.7.</span></p>
<spanid="id22"></span><h2><aclass="toc-backref"href="#contents">postgresql_db</a><aclass="headerlink"href="#postgresql-db"title="Permalink to this headline">¶</a></h2>
<spanid="id23"></span><h2><aclass="toc-backref"href="#contents">postgresql_db</a><aclass="headerlink"href="#postgresql-db"title="Permalink to this headline">¶</a></h2>
<pclass="versionadded">
<spanclass="versionmodified">New in version 0.6.</span></p>
<p>Add or remove PostgreSQL databases from a remote host.</p>
@ -1432,7 +1495,7 @@ host before using this module.</p>
</div>
</div>
<divclass="section"id="postgresql-user">
<spanid="id23"></span><h2><aclass="toc-backref"href="#contents">postgresql_user</a><aclass="headerlink"href="#postgresql-user"title="Permalink to this headline">¶</a></h2>
<spanid="id24"></span><h2><aclass="toc-backref"href="#contents">postgresql_user</a><aclass="headerlink"href="#postgresql-user"title="Permalink to this headline">¶</a></h2>
<pclass="versionadded">
<spanclass="versionmodified">New in version 0.6.</span></p>
<p>Add or remove PostgreSQL users (roles) from a remote host and, optionally, grant the users
@ -1529,7 +1592,7 @@ happened and separately if the user was removed or not.</p>
</div>
</div>
<divclass="section"id="raw">
<spanid="id24"></span><h2><aclass="toc-backref"href="#contents">raw</a><aclass="headerlink"href="#raw"title="Permalink to this headline">¶</a></h2>
<spanid="id25"></span><h2><aclass="toc-backref"href="#contents">raw</a><aclass="headerlink"href="#raw"title="Permalink to this headline">¶</a></h2>
<p>Executes a low-down and dirty SSH command, not going through the module subsystem.</p>
<p>This is useful and should only be done in two cases. The first case is installing
python-simplejson on older (python 2.4 and before) hosts that need it as a dependency
@ -1544,7 +1607,7 @@ for this module.</p>
</div>
</div>
<divclass="section"id="service">
<spanid="id25"></span><h2><aclass="toc-backref"href="#contents">service</a><aclass="headerlink"href="#service"title="Permalink to this headline">¶</a></h2>
<spanid="id26"></span><h2><aclass="toc-backref"href="#contents">service</a><aclass="headerlink"href="#service"title="Permalink to this headline">¶</a></h2>
<p>Controls services on remote machines.</p>
<tableborder="1"class="docutils">
<colgroup>
@ -1597,7 +1660,7 @@ service name=foo pattern=/usr/bin/foo state=started</pre>
</div>
</div>
<divclass="section"id="setup">
<spanid="id26"></span><h2><aclass="toc-backref"href="#contents">setup</a><aclass="headerlink"href="#setup"title="Permalink to this headline">¶</a></h2>
<spanid="id27"></span><h2><aclass="toc-backref"href="#contents">setup</a><aclass="headerlink"href="#setup"title="Permalink to this headline">¶</a></h2>
<p>This module is automatically called by playbooks to gather useful variables about remote hosts that can be used
in playbooks. It can also be executed directly by /usr/bin/ansible to check what variables are available
to a host.</p>
@ -1679,7 +1742,7 @@ on your remote systems.</p>
</div>
</div>
<divclass="section"id="shell">
<spanid="id27"></span><h2><aclass="toc-backref"href="#contents">shell</a><aclass="headerlink"href="#shell"title="Permalink to this headline">¶</a></h2>
<spanid="id28"></span><h2><aclass="toc-backref"href="#contents">shell</a><aclass="headerlink"href="#shell"title="Permalink to this headline">¶</a></h2>
<p>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.</p>
@ -1729,7 +1792,7 @@ your best judgement.</p>
</div>
</div>
<divclass="section"id="subversion">
<spanid="id28"></span><h2><aclass="toc-backref"href="#contents">subversion</a><aclass="headerlink"href="#subversion"title="Permalink to this headline">¶</a></h2>
<spanid="id29"></span><h2><aclass="toc-backref"href="#contents">subversion</a><aclass="headerlink"href="#subversion"title="Permalink to this headline">¶</a></h2>
<pclass="versionadded">
<spanclass="versionmodified">New in version 0.7.</span></p>
<p>Deploys a subversion repository.</p>
@ -1771,7 +1834,7 @@ discarded. If no, this module will fail if it encounters modified files.</td>
</div>
</div>
<divclass="section"id="supervisorctl">
<spanid="id29"></span><h2><aclass="toc-backref"href="#contents">supervisorctl</a><aclass="headerlink"href="#supervisorctl"title="Permalink to this headline">¶</a></h2>
<spanid="id30"></span><h2><aclass="toc-backref"href="#contents">supervisorctl</a><aclass="headerlink"href="#supervisorctl"title="Permalink to this headline">¶</a></h2>
<pclass="versionadded">
<spanclass="versionmodified">New in version 0.7.</span></p>
<p>Manage the state of a program or group of programs running via Supervisord</p>
@ -1807,7 +1870,7 @@ discarded. If no, this module will fail if it encounters modified files.</td>
</div>
</div>
<divclass="section"id="template">
<spanid="id30"></span><h2><aclass="toc-backref"href="#contents">template</a><aclass="headerlink"href="#template"title="Permalink to this headline">¶</a></h2>
<spanid="id31"></span><h2><aclass="toc-backref"href="#contents">template</a><aclass="headerlink"href="#template"title="Permalink to this headline">¶</a></h2>
<p>Templates a file out to a remote server.</p>
<tableborder="1"class="docutils">
<colgroup>
@ -1847,7 +1910,7 @@ a relative or absolute path.</td>
</div>
</div>
<divclass="section"id="user">
<spanid="id31"></span><h2><aclass="toc-backref"href="#contents">user</a><aclass="headerlink"href="#user"title="Permalink to this headline">¶</a></h2>
<spanid="id32"></span><h2><aclass="toc-backref"href="#contents">user</a><aclass="headerlink"href="#user"title="Permalink to this headline">¶</a></h2>
<p>Creates user accounts, manipulates existing user accounts, and removes user accounts.</p>
<tableborder="1"class="docutils">
<colgroup>
@ -1946,7 +2009,7 @@ user name=mdehaan state=absent force=yes</pre>
</div>
</div>
<divclass="section"id="virt">
<spanid="id32"></span><h2><aclass="toc-backref"href="#contents">virt</a><aclass="headerlink"href="#virt"title="Permalink to this headline">¶</a></h2>
<spanid="id33"></span><h2><aclass="toc-backref"href="#contents">virt</a><aclass="headerlink"href="#virt"title="Permalink to this headline">¶</a></h2>
<p>Manages virtual machines supported by libvirt. Requires that libvirt be installed
on the managed machine.</p>
<tableborder="1"class="docutils">
@ -2006,7 +2069,7 @@ ansible host -m virt -a "command=virttype"</pre>
</div>
</div>
<divclass="section"id="yum">
<spanid="id33"></span><h2><aclass="toc-backref"href="#contents">yum</a><aclass="headerlink"href="#yum"title="Permalink to this headline">¶</a></h2>
<spanid="id34"></span><h2><aclass="toc-backref"href="#contents">yum</a><aclass="headerlink"href="#yum"title="Permalink to this headline">¶</a></h2>
<p>Will install, upgrade, remove, and list packages with the yum package manager.</p>