mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Allude to apt on the examples page.
This commit is contained in:
30
modules.html
30
modules.html
@@ -193,7 +193,7 @@ command line or playbooks, you don’t really need to know much about
|
||||
that. If you’re writing your own module, you care, and this means you do
|
||||
not have to write modules in any particular language – you get tho choose.</p>
|
||||
<p>Most modules other than command are <cite>idempotent</cite>, meaning they will seek
|
||||
to avoid changes to the system unless a change needs to be made. When using ansible
|
||||
to avoid changes to the system unless a change needs to be made. When using Ansible
|
||||
playbooks, these modules can trigger ‘change events’. Unless otherwise
|
||||
noted, any given module does support change hooks.</p>
|
||||
<p>Let’s see what’s available in the Ansible module library, out of the box:</p>
|
||||
@@ -209,7 +209,7 @@ noted, any given module does support change hooks.</p>
|
||||
<li>Can be either ‘installed’ or ‘removed’. NOTE: support</li>
|
||||
</ul>
|
||||
<p>for ‘latest’ (see yum, below) is in work.</p>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from Ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>apt pkg=foo ensure=removed
|
||||
apt pkg=foo ensure=installed</pre>
|
||||
</div>
|
||||
@@ -228,7 +228,7 @@ paths to commands must be fully qualified.</p>
|
||||
<p>This module does not support change hooks and returns the return code
|
||||
from the program as well as timing information about how long the
|
||||
command was running for.</p>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from Ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>command /sbin/shutdown -t now</pre>
|
||||
</div>
|
||||
</div>
|
||||
@@ -247,7 +247,7 @@ absolute or relative path.</li>
|
||||
<li>Remote absolute path where the file should end up.</li>
|
||||
</ul>
|
||||
<p>This module also returns md5sum information about the resultant file.</p>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from Ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>copy src=/srv/myfiles/foo.conf dest=/etc/foo.conf owner=foo group=foo mode=0644</pre>
|
||||
</div>
|
||||
</div>
|
||||
@@ -285,7 +285,7 @@ to the file module are also available when running the <cite>copy</cite> or <cit
|
||||
<ul class="simple">
|
||||
<li>name of group that should own the file or directory, as would be given to <cite>chgrp</cite></li>
|
||||
</ul>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from Ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>file dest=/etc/foo.conf owner=foo group=foo mode=0644
|
||||
file dest=/some/path owner=foo group=foo state=directory
|
||||
file dest/path/to/delete state=absent</pre>
|
||||
@@ -307,7 +307,7 @@ file dest/path/to/delete state=absent</pre>
|
||||
<li>What version to check out – either the git SHA, the literal string
|
||||
<tt class="docutils literal"><span class="pre">HEAD</span></tt>, or a tag name.</li>
|
||||
</ul>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from Ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<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>
|
||||
@@ -342,7 +342,7 @@ unless necessary. <tt class="docutils literal"><span class="pre">restarted</spa
|
||||
<ul class="simple">
|
||||
<li>The name of the service.</li>
|
||||
</ul>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from Ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>service name=httpd state=started
|
||||
service name=httpd state=stopped
|
||||
service name=httpd state=restarted</pre>
|
||||
@@ -366,13 +366,13 @@ tell their source. All variables are then bubbled up to the caller.</p>
|
||||
<tt class="docutils literal"><span class="pre">key=value</span></tt> pair in the JSON file for use in templating.</li>
|
||||
</ul>
|
||||
</div></blockquote>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from Ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>vars:
|
||||
ntpserver: 'ntp.example.com'
|
||||
xyz: 1234</pre>
|
||||
</div>
|
||||
<p>Example action from <cite>/usr/bin/ansible</cite>:</p>
|
||||
<div class="highlight-python"><pre>ansible -m all setup -a "ntpserver=ntp.example.com xyz=1234"</pre>
|
||||
<p>Example action from <cite>/usr/bin/Ansible</cite>:</p>
|
||||
<div class="highlight-python"><pre>Ansible -m all setup -a "ntpserver=ntp.example.com xyz=1234"</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="shell">
|
||||
@@ -445,7 +445,7 @@ example in the github examples directory for what this looks like in a playbook.
|
||||
<ul class="simple">
|
||||
<li>Defaults to ‘present’. When ‘absent’, the user account will be removed if present.</li>
|
||||
</ul>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<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>
|
||||
</div>
|
||||
@@ -467,7 +467,7 @@ user name=mdehaan state=absent</pre>
|
||||
various configuration attributes. Values include ‘installed’, ‘updates’,
|
||||
‘available’, ‘repos’, or any package specifier.</li>
|
||||
</ul>
|
||||
<p>Example action from ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<p>Example action from Ansible <a class="reference internal" href="playbooks.html"><em>Playbooks</em></a>:</p>
|
||||
<div class="highlight-python"><pre>yum pkg=httpd ensure=latest
|
||||
yum pkg=httpd ensure=removed
|
||||
yum pkg=httpd ensure=installed</pre>
|
||||
@@ -480,14 +480,14 @@ yum pkg=httpd ensure=installed</pre>
|
||||
<p class="first admonition-title">See also</p>
|
||||
<dl class="last docutils">
|
||||
<dt><a class="reference internal" href="examples.html"><em>Command Line Examples</em></a></dt>
|
||||
<dd>Examples of using modules in /usr/bin/ansible</dd>
|
||||
<dd>Examples of using modules in /usr/bin/Ansible</dd>
|
||||
<dt><a class="reference internal" href="playbooks.html"><em>Playbooks</em></a></dt>
|
||||
<dd>Examples of using modules with /usr/bin/ansible-playbook</dd>
|
||||
<dd>Examples of using modules with /usr/bin/Ansible-playbook</dd>
|
||||
<dt><a class="reference internal" href="moduledev.html"><em>Module Development Guide</em></a></dt>
|
||||
<dd>How to write your own modules</dd>
|
||||
<dt><a class="reference internal" href="api.html"><em>API & Integrations</em></a></dt>
|
||||
<dd>Examples of using modules with the Python API</dd>
|
||||
<dt><a class="reference external" href="http://groups.google.com/group/ansible-project">Mailing List</a></dt>
|
||||
<dt><a class="reference external" href="http://groups.google.com/group/Ansible-project">Mailing List</a></dt>
|
||||
<dd>Questions? Help? Ideas? Stop by the list on Google Groups</dd>
|
||||
<dt><a class="reference external" href="http://irc.freenode.net">irc.freenode.net</a></dt>
|
||||
<dd>#ansible IRC chat channel</dd>
|
||||
|
||||
Reference in New Issue
Block a user