1CDIST-TYPE__DOWNLOAD(7)              cdist             CDIST-TYPE__DOWNLOAD(7)
2
3
4

NAME

6       cdist-type__download - Download a file
7

DESCRIPTION

9       Destination ($__object_id) in target host must be persistent storage in
10       order to calculate checksum and decide if file must be (re-)downloaded.
11
12       By default type will try to use wget, curl or fetch.  If download  hap‐
13       pens  in  target  (see  --download)  then  type  will  fallback to (and
14       install) wget.
15
16       If download happens in local machine, then environment  variables  like
17       {http,https,ftp}_proxy   etc   can   be   used   on   cdist   execution
18       (http_proxy=foo cdist config ...).
19

REQUIRED PARAMETERS

21       url    File's URL.
22
23       sum    Checksum of file going to be downloaded.  By default  output  of
24              cksum  without  filename  is  expected.  Other hash formats sup‐
25              ported with prefixes: md5:, sha1: and sha256:.
26

OPTIONAL PARAMETERS

28       download
29              If local (default), then download file to local storage and copy
30              it to target host. If remote, then download happens in target.
31
32       cmd-get
33              Command  used  for  downloading.  Command must output to stdout.
34              Parameter will be used for printf and must include only one for‐
35              mat  specification  %s which will become URL.  For example: wget
36              -O - '%s'.
37
38       cmd-sum
39              Command used for checksum calculation.  Command output and --sum
40              parameter  must  match.   Parameter  will be used for printf and
41              must include only one format specification %s which will  become
42              destination.  For example: md5sum '%s' | awk '{print $1}'.
43
44       onchange
45              Execute this command after download.
46

EXAMPLES

48          __directory /opt/cpma
49
50          require='__directory/opt/cpma' \
51              __download /opt/cpma/cnq3.zip \
52                  --url https://cdn.playmorepromode.com/files/cnq3/cnq3-1.51.zip \
53                  --sum md5:46da3021ca9eace277115ec9106c5b46
54
55          require='__download/opt/cpma/cnq3.zip' \
56              __unpack /opt/cpma/cnq3.zip \
57                  --backup-destination \
58                  --preserve-archive \
59                  --destination /opt/cpma/server
60

AUTHORS

62       Ander Punnar <ander-at-kvlt-dot-ee>
63

COPYING

65       Copyright  (C) 2020 Ander Punnar. You can redistribute it and/or modify
66       it under the terms of the GNU General Public License  as  published  by
67       the  Free  Software Foundation, either version 3 of the License, or (at
68       your option) any later version.
69
71       ungleich GmbH 2020
72
73
74
75
766.9.4                            Dec 21, 2020          CDIST-TYPE__DOWNLOAD(7)
Impressum