cdist-web/src/extra/manual/3.1.11/man7/cdist-type__staged_file.html

80 lines
6.2 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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>cdist-type__staged_file(7)</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /></head><body><div xml:lang="en" class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="idm139677586805680"></a>cdist-type__staged_file(7)</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Steven</span> <span class="surname">Armstrong</span></h3><code class="email">&lt;<a class="email" href="mailto:steven-cdist--@--armstrong.cc">steven-cdist--@--armstrong.cc</a>&gt;</code></div></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="#_name">1. NAME</a></span></dt><dt><span class="section"><a href="#_description">2. DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_required_parameters">3. REQUIRED PARAMETERS</a></span></dt><dt><span class="section"><a href="#_optional_parameters">4. OPTIONAL PARAMETERS</a></span></dt><dt><span class="section"><a href="#_examples">5. EXAMPLES</a></span></dt><dt><span class="section"><a href="#_see_also">6. SEE ALSO</a></span></dt><dt><span class="section"><a href="#_copying">7. COPYING</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_name"></a>1. NAME</h2></div></div></div><p>cdist-type__staged_file - manage staged files</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_description"></a>2. DESCRIPTION</h2></div></div></div><p>Manages a staged file that is downloaded on the server (the machine running
cdist) and then deployed to the target host using the __file type.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_required_parameters"></a>3. REQUIRED PARAMETERS</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">
source
</span></dt><dd>
the URL from which to retreive the source file.
e.g.
<a class="ulink" href="https://dl.bintray.com/mitchellh/consul/0.4.1_linux_amd64.zip" target="_top">https://dl.bintray.com/mitchellh/consul/0.4.1_linux_amd64.zip</a>
<a class="ulink" href="file:///path/to/local/file" target="_top">file:///path/to/local/file</a>
</dd><dt><span class="term">
cksum
</span></dt><dd>
the output of running the command: <code class="literal">cksum $source-file</code>
e.g.
$ echo foobar &gt; /tmp/foobar
$ cksum /tmp/foobar
857691210 7 /tmp/foobar
If either checksum or file size has changed the file will be
(re)fetched from the --source. The file name can be omitted and is
ignored if given.
</dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_optional_parameters"></a>4. OPTIONAL PARAMETERS</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">
fetch-command
</span></dt><dd>
the command used to fetch the staged file using printf formatting.
Where a single %s will be replaced with the value of the given --source
parameter. The --fetch-command is expected to output the fetched file to
stdout.
Defaults to <span class="emphasis"><em>curl -s -L "%s"</em></span>.
</dd><dt><span class="term">
group
</span></dt><dd>
see cdist-type__file
</dd><dt><span class="term">
owner
</span></dt><dd>
see cdist-type__file
</dd><dt><span class="term">
mode
</span></dt><dd>
see cdist-type__file
</dd><dt><span class="term">
prepare-command
</span></dt><dd><p class="simpara">
the optional command used to prepare or preprocess the staged file for later
use by the file type.
If given, it must be a string in printf formatting where a single %s will
be replaced with the last segment (filename) of the value of the given
--source parameter.
It is executed in the same directory into which the fetched file has been
saved. The --prepare-command is expected to output the final file to stdout.
</p><pre class="literallayout"> So for example given a --source of https://example.com/my-zip.zip, and a
--prepare-command of 'unzip -p "%s"', the code `unzip -p "my-zip.zip"` will
be executed in the folder containing the downloaded file my-zip.zip.
A more complex example might be --prepare-command 'tar -xz "%s"; cat path/from/archive'
stage-dir::
the directory in which to store downloaded and prepared files.
Defaults to '/var/tmp/cdist/__staged_file'
state::
see cdist-type__file</pre></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_examples"></a>5. EXAMPLES</h2></div></div></div><pre class="screen">__staged_file /usr/local/bin/consul \
--source file:///path/to/local/copy/consul \
--cksum '428915666 15738724' \
--state present \
--group root \
--owner root \
--mode 755
__staged_file /usr/local/bin/consul \
--source https://dl.bintray.com/mitchellh/consul/0.4.1_linux_amd64.zip \
--cksum '428915666 15738724' \
--fetch-command 'curl -s -L "%s"' \
--prepare-command 'unzip -p "%s"' \
--state present \
--group root \
--owner root \
--mode 755</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_see_also"></a>6. SEE ALSO</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a href="../man7/cdist-type.html">cdist-type(7)</a>
</li><li class="listitem">
<a href="../man7/cdist-type__file.html">cdist-type__file(7)</a>
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_copying"></a>7. COPYING</h2></div></div></div><p>Copyright (C) 2015 Steven Armstrong. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3).</p></div></div></body></html>