mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Docs build
This commit is contained in:
24
modules.html
24
modules.html
@@ -264,15 +264,16 @@ module behind the scenes.</p>
|
||||
</div>
|
||||
<div class="section" id="file">
|
||||
<h2>file<a class="headerlink" href="#file" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Sets attributes of files and directories, or removes files/directories. All parameters available
|
||||
to the file module are also available when running the <cite>copy</cite> or <cite>template</cite> modules.</p>
|
||||
<p>Sets attributes of files, symlinks, and directories, or removes files/symlinks/directories.
|
||||
All parameters available to the file module are also available when running the <cite>copy</cite> or
|
||||
<cite>template</cite> modules.</p>
|
||||
<p><em>dest</em>:</p>
|
||||
<ul class="simple">
|
||||
<li>absolute path to a file on the filesystem.</li>
|
||||
</ul>
|
||||
<p><em>state</em>:</p>
|
||||
<ul class="simple">
|
||||
<li>either ‘file’, ‘directory’, or ‘absent’. The default is ‘file’. If ‘directory’, the directory and all immediate subdirectories will be created if they do not exist. If ‘file’, the file will NOT be created if it does not exist, specify <cite>copy</cite> or <cite>template</cite> for the module name instead if you need to put content at the specified location. If ‘absent’, directories will be recursively deleted, and files or symlinks will be unlinked.</li>
|
||||
<li>either ‘file’, ‘link’, ‘directory’, or ‘absent’. The default is ‘file’. If ‘directory’, the directory and all immediate subdirectories will be created if they do not exist. If ‘file’, the file will NOT be created if it does not exist, specify <cite>copy</cite> or <cite>template</cite> for the module name instead if you need to put content at the specified location. If ‘link’, the symbolic link will be created or changed. If ‘absent’, directories will be recursively deleted, and files or symlinks will be unlinked.</li>
|
||||
</ul>
|
||||
<p><em>mode</em>:</p>
|
||||
<ul class="simple">
|
||||
@@ -286,10 +287,19 @@ 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><em>src</em>:</p>
|
||||
<ul class="simple">
|
||||
<li>path of the file to link to (applies only to ‘link’ state)</li>
|
||||
</ul>
|
||||
<p><em>dest</em>:</p>
|
||||
<ul class="simple">
|
||||
<li>location where the symlink will be created for ‘link’ state, also an alias for ‘path’.</li>
|
||||
</ul>
|
||||
<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>
|
||||
<div class="highlight-python"><pre>file path=/etc/foo.conf owner=foo group=foo mode=0644
|
||||
file path=/some/path owner=foo group=foo state=directory
|
||||
file path=/path/to/delete state=absent
|
||||
file src=/file/to/link/to dest=/path/to/symlink owner=foo group=foo state=link</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="git">
|
||||
@@ -540,7 +550,7 @@ yum pkg=httpd ensure=installed</pre>
|
||||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>
|
||||
© Copyright 2012 Michael DeHaan.<br/>
|
||||
Last updated on Apr 02, 2012.<br/>
|
||||
Last updated on Apr 04, 2012.<br/>
|
||||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.<br/>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user