Minion side functions for salt-cp
Members
Download and cache everything under a directory from the master
CLI Example:
salt '*' cp.cache_dir salt://path/to/dir
Used to cache a single file in the local salt-master file cache.
CLI Example:
salt '*' cp.cache_file salt://path/to/file
Used to gather many files from the master, the gathered files will be saved in the minion cachedir reflective to the paths retrieved from the master.
CLI Example:
salt '*' cp.cache_files salt://pathto/file1,salt://pathto/file1
Cache a local file on the minion in the localfiles cache
CLI Example:
salt '*' cp.cache_local_file /etc/hosts
Retrieve all of the files on the master and cache them locally
CLI Example:
salt '*' cp.cache_master
Used to recursively copy a directory from the salt master
CLI Example:
salt '*' cp.get_dir salt://path/to/dir/ /minion/dest
Used to get a single file from the salt master
CLI Example:
salt '*' cp.get_file salt://path/to/file /minion/dest
Render a file as a template before settign it down
CLI Example:
salt '*' cp.get_template salt://path/to/template /minion/dest
Used to get a single file from a URL.
CLI Example:
salt '*' cp.get_url salt://my/file /tmp/mine
salt '*' cp.get_url http://www.slashdot.org /tmp/index.html
Return the hash of a file, to get the hash of a file on the salt master file server prepend the path with salt://<file on server> otherwise, prepend the file with / for a local file.
CLI Example:
salt '*' cp.hash_file salt://path/to/file
Return a boolean if the given path on the master has been cached on the minion
CLI Example:
salt '*' cp.is_cached salt://path/to/file
List all of the files stored on the master
CLI Example:
salt '*' cp.list_master
List all of the files cached on the minion
CLI Example:
salt '*' cp.list_minion