CDIST-TYPE__STAGED_FILE(7) | cdist | CDIST-TYPE__STAGED_FILE(7) |
cdist-type__staged_file - Manage staged files
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.
$ echo foobar > /tmp/foobar $ cksum /tmp/foobar 857691210 7 /tmp/foobar
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.
So for example given a --source of https://example.com/my-zip.zip, and a --prepare-command of 'unzip -p "%s"', the code unzip -p "my-zip.zip" will be executed in the folder containing the downloaded file my-zip.zip. A more complex example might be --prepare-command 'tar -xz "%s"; cat path/from/archive'
__staged_file /usr/local/bin/consul \
--source file:///path/to/local/copy/consul \
--cksum '428915666 15738724' \
--state present \
--group root \
--owner root \
--mode 755 __staged_file /usr/local/bin/consul \
--source https://dl.bintray.com/mitchellh/consul/0.4.1_linux_amd64.zip \
--cksum '428915666 15738724' \
--fetch-command 'curl -s -L "%s"' \
--prepare-command 'unzip -p "%s"' \
--state present \
--group root \
--owner root \
--mode 755
Steven Armstrong <steven-cdist--@--armstrong.cc>
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.
February 16, 2019 | 4.10.6 |