1CDIST-TYPE__DOWNLOAD(7) cdist CDIST-TYPE__DOWNLOAD(7)
2
3
4
6 cdist-type__download - Download a file
7
9 By default type will try to use wget, curl or fetch. If download hap‐
10 pens in target (see --download) then type will fallback to (and in‐
11 stall) wget.
12
13 If download happens in local machine, then environment variables like
14 {http,https,ftp}_proxy etc can be used on cdist execution
15 (http_proxy=foo cdist config ...).
16
18 url File's URL.
19
21 sum Checksum is used to decide if existing destination file must be
22 redownloaded. By default output of cksum without filename is
23 expected. Other hash formats supported with prefixes: md5:,
24 sha1: and sha256:.
25
26 download
27 If local (default), then download file to local storage and copy
28 it to target host. If remote, then download happens in target.
29
30 cmd-get
31 Command used for downloading. Command must output to stdout.
32 Parameter will be used for printf and must include only one for‐
33 mat specification %s which will become URL. For example: wget
34 -O - '%s'.
35
36 cmd-sum
37 Command used for checksum calculation. Command output and --sum
38 parameter must match. Parameter will be used for printf and
39 must include only one format specification %s which will become
40 destination. For example: md5sum '%s' | awk '{print $1}'.
41
42 onchange
43 Execute this command after download.
44
46 __directory /opt/cpma
47
48 require='__directory/opt/cpma' \
49 __download /opt/cpma/cnq3.zip \
50 --url https://cdn.playmorepromode.com/files/cnq3/cnq3-1.51.zip \
51 --sum md5:46da3021ca9eace277115ec9106c5b46
52
53 require='__download/opt/cpma/cnq3.zip' \
54 __unpack /opt/cpma/cnq3.zip \
55 --backup-destination \
56 --preserve-archive \
57 --destination /opt/cpma/server
58
60 Ander Punnar <ander-at-kvlt-dot-ee>
61
63 Copyright (C) 2021 Ander Punnar. You can redistribute it and/or modify
64 it under the terms of the GNU General Public License as published by
65 the Free Software Foundation, either version 3 of the License, or (at
66 your option) any later version.
67
69 ungleich GmbH 2020
70
71
72
73
746.9.6 Apr 20, 2021 CDIST-TYPE__DOWNLOAD(7)