.\" Man page generated from reStructuredText. . .TH "CDIST-TYPE__STAGED_FILE" "7" "Jun 23, 2019" "5.1.2" "cdist" . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH NAME .sp cdist\-type__staged_file \- Manage staged files .SH DESCRIPTION .sp 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. .SH REQUIRED PARAMETERS .INDENT 0.0 .TP .B source the URL from which to retrieve the source file. e.g. .INDENT 7.0 .IP \(bu 2 \fI\%https://dl.bintray.com/mitchellh/consul/0.4.1_linux_amd64.zip\fP .IP \(bu 2 \fI\%file:///path/to/local/file\fP .UNINDENT .TP .B cksum the output of running the command: \fIcksum $source\-file\fP e.g.: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C $ echo foobar > /tmp/foobar $ cksum /tmp/foobar 857691210 7 /tmp/foobar .ft P .fi .UNINDENT .UNINDENT .sp 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. .UNINDENT .SH OPTIONAL PARAMETERS .INDENT 0.0 .TP .B fetch\-command 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 \(aqcurl \-s \-L "%s"\(aq. .TP .B group see cdist\-type__file .TP .B owner see cdist\-type__file .TP .B mode see cdist\-type__file .TP .B prepare\-command 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. .sp So for example given a \-\-source of \fI\%https://example.com/my\-zip.zip\fP, and a \-\-prepare\-command of \(aqunzip \-p "%s"\(aq, the code \fIunzip \-p "my\-zip.zip"\fP will be executed in the folder containing the downloaded file my\-zip.zip. A more complex example might be \-\-prepare\-command \(aqtar \-xz "%s"; cat path/from/archive\(aq .TP .B stage\-dir the directory in which to store downloaded and prepared files. Defaults to \(aq/var/tmp/cdist/__staged_file\(aq .TP .B state see cdist\-type__file .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C __staged_file /usr/local/bin/consul \e \-\-source file:///path/to/local/copy/consul \e \-\-cksum \(aq428915666 15738724\(aq \e \-\-state present \e \-\-group root \e \-\-owner root \e \-\-mode 755 __staged_file /usr/local/bin/consul \e \-\-source https://dl.bintray.com/mitchellh/consul/0.4.1_linux_amd64.zip \e \-\-cksum \(aq428915666 15738724\(aq \e \-\-fetch\-command \(aqcurl \-s \-L "%s"\(aq \e \-\-prepare\-command \(aqunzip \-p "%s"\(aq \e \-\-state present \e \-\-group root \e \-\-owner root \e \-\-mode 755 .ft P .fi .UNINDENT .UNINDENT .SH SEE ALSO .sp \fBcdist\-type__file\fP(7) .SH AUTHORS .sp Steven Armstrong <\fI\%steven\-cdist\-\-@\-\-armstrong.cc\fP> .SH COPYING .sp Copyright (C) 2015 Steven Armstrong. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. .SH COPYRIGHT ungleich GmbH 2019 .\" Generated by docutils manpage writer. .