CDIST-TYPE__DOWNLOAD(7)
π cdist-type__download π
okay so bestie, welcome to cdist-type__download(7) β the manual page for the cdist type that downloads a file. that's it, that's the whole vibe, and it slays. π¦
β¨ DESCRIPTION β¨
by default the type is gonna try to use curl, fetch or wget. like, it'll figure it out. π
if the download happens in the target (peep --download), then the type falls back to wget β and installs it, no cap. π
if the download happens on the local machine, then environment variables like {http,https,ftp}_proxy and friends can be used when cdist runs. for example:
http_proxy=foo cdist config ...
lowkey so handy. π«Ά
and hmm, want to change the downloaded file's owner, group or permissions? then do this:
require='__download/path/to/file' __file ....
periodt. πΈ
π₯ REQUIRED PARAMETERS π₯
urlβ the file's URL. you literally cannot skip this one bestie, it's giving mandatory. π
π OPTIONAL PARAMETERS π
destinationβ where the downloaded file goes in the target. if you don't set it,$__object_idgets used instead. πsumβ the checksum. supported formats:cksumoutput without the file name, plus MD5, SHA1 and SHA256.
the type tries to detect the hash format with regexes, but the prefixes cksum:, md5:, sha1: and sha256: are supported too. π§
checksums have two purposes, bestie β state check and post-download verification. in the state check, if the destination checksum mismatches, then the content of the URL gets downloaded to a temporary file. if the downloaded temporary file's checksum matches, then it gets moved to destination (overwritten). iconic behaviour honestly. β¨
for local downloads it is expected that usable utilities for checksum calculation exist in the system. so like, have those ready. π
downloadβ iflocal(which is the default), then the file is downloaded to local storage and copied to the target host. ifremote, then the download happens in the target. π
for local downloads it is expected that usable utilities for downloading exist in the system. the type will try to use curl, fetch or wget. π«‘
cmd-getβ the command used for downloading. the command must output to stdout. this parameter will be used forprintfand must include only one format specification%s, which becomes the URL. for example:
wget -O - '%s'
π
cmd-sumβ the command used for checksum calculation. the command output and the--sumparameter must match. this parameter will be used forprintfand must include only one format specification%s, which becomes the destination. for example:
md5sum '%s' | awk '{print $1}'
β
onchangeβ execute this command after download. that's the whole thing. go off. π₯
π EXAMPLES π
__directory /opt/cpma
require='__directory/opt/cpma' \
__download /opt/cpma/cnq3.zip \
--url https://cdn.playmorepromode.com/files/cnq3/cnq3-1.51.zip \
--sum 46da3021ca9eace277115ec9106c5b46
require='__download/opt/cpma/cnq3.zip' \
__unpack /opt/cpma/cnq3.zip \
--backup-destination \
--preserve-archive \
--destination /opt/cpma/server
look at that. clean. immaculate. no notes. π
π AUTHORS π
Ander Punnar <ander-at-kvlt-dot-ee> β thank you for your service bestie π«Ά
π COPYING π
Copyright (C) 2021 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. π
π COPYRIGHT π
ungleich GmbH 2021
and that's the whole page, bestie!! π this is version 7.0.0, dated Jul 31, 2022, and it lives in the cdist manual, section 7. go download something cute. bye!! π¦β¨
π¦ where this page comes from
- fedora 43: cdist 7.0.0-16.fc43 Β· GPL-3.0-only
- fedora 44: cdist 7.0.0-18.fc44 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms