.\" Man page generated from reStructuredText. . .TH "CDIST-TYPE__DOWNLOAD" "7" "Feb 07, 2021" "6.9.4" "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__download \- Download a file .SH DESCRIPTION .sp Destination (\fB$__object_id\fP) in target host must be persistent storage in order to calculate checksum and decide if file must be (re\-)downloaded. .sp By default type will try to use \fBwget\fP, \fBcurl\fP or \fBfetch\fP\&. If download happens in target (see \fB\-\-download\fP) then type will fallback to (and install) \fBwget\fP\&. .sp If download happens in local machine, then environment variables like \fB{http,https,ftp}_proxy\fP etc can be used on cdist execution (\fBhttp_proxy=foo cdist config ...\fP). .SH REQUIRED PARAMETERS .INDENT 0.0 .TP .B url File\(aqs URL. .TP .B sum Checksum of file going to be downloaded. By default output of \fBcksum\fP without filename is expected. Other hash formats supported with prefixes: \fBmd5:\fP, \fBsha1:\fP and \fBsha256:\fP\&. .UNINDENT .SH OPTIONAL PARAMETERS .INDENT 0.0 .TP .B download If \fBlocal\fP (default), then download file to local storage and copy it to target host. If \fBremote\fP, then download happens in target. .TP .B cmd\-get Command used for downloading. Command must output to \fBstdout\fP\&. Parameter will be used for \fBprintf\fP and must include only one format specification \fB%s\fP which will become URL. For example: \fBwget \-O \- \(aq%s\(aq\fP\&. .TP .B cmd\-sum Command used for checksum calculation. Command output and \fB\-\-sum\fP parameter must match. Parameter will be used for \fBprintf\fP and must include only one format specification \fB%s\fP which will become destination. For example: \fBmd5sum \(aq%s\(aq | awk \(aq{print $1}\(aq\fP\&. .TP .B onchange Execute this command after download. .UNINDENT .SH EXAMPLES .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C __directory /opt/cpma require=\(aq__directory/opt/cpma\(aq \e __download /opt/cpma/cnq3.zip \e \-\-url https://cdn.playmorepromode.com/files/cnq3/cnq3\-1.51.zip \e \-\-sum md5:46da3021ca9eace277115ec9106c5b46 require=\(aq__download/opt/cpma/cnq3.zip\(aq \e __unpack /opt/cpma/cnq3.zip \e \-\-backup\-destination \e \-\-preserve\-archive \e \-\-destination /opt/cpma/server .ft P .fi .UNINDENT .UNINDENT .SH AUTHORS .sp Ander Punnar .SH COPYING .sp Copyright (C) 2020 Ander Punnar. 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 2020 .\" Generated by docutils manpage writer. .