pallet.action.remote-file documentation

Action to specify remote file content.

remote-file has many options for the content of remote files. Ownership and mode can of course be specified. By default the remote file is versioned, and multiple versions are kept.

Modification of remote files outside of pallet cause an error to be raised by default.

all-options

A vector of the options accepted by remote-file. Can be used for option forwarding when calling remote-file from other crates.

content-options

A vector of the options accepted by remote-file. Can be used for option forwarding when calling remote-file from other crates.

ownership-options

A vector of options for controlling ownership. Can be used for option forwarding when calling remote-file from other crates.

remote-file

[session path & {:keys [action url local-file remote-file link content literal template values md5 md5-url owner group mode force blob blobstore overwrite-changes no-versioning max-versions flag-on-changed local-file-options], :as options}]

Remote file content management.

The remote-file action can specify the content of a remote file in a number different ways.

By default, the remote-file is versioned, and 5 versions are kept.

The remote content is also verified against it's md5 hash. If the contents of the remote file have changed (e.g. have been edited on the remote machine) then by default the file will not be overwritten, and an error will be raised. To force overwrite, call set-force-overwrite before running converge or lift.

Options for specifying the file's content are: :url url - download the specified url to the given filepath :content string - use the specified content directly :local-file path - use the file on the local machine at the given path :remote-file path - use the file on the remote machine at the given path :link - file to link to :literal - prevent shell expansion on content :md5 - md5 for file :md5-url - a url containing file's md5 :template - specify a template to be interpolated :values - values for interpolation :blob - map of :container, :path :blobstore - a jclouds blobstore object (override blobstore in session) :insecure - boolean to specify ignoring of SLL certs

Options for version control are: :overwrite-changes - flag to force overwriting of locally modified content :no-versioning - do not version the file :max-versions - specfy the number of versions to keep (default 5) :flag-on-changed - flag to set if file is changed

Options for specifying the file's permissions are: :owner user-name :group group-name :mode file-mode

To copy the content of a local file to a remote file: (remote-file session "remote/path" :local-file "local/path")

To copy the content of one remote file to another remote file: (remote-file session "remote/path" :remote-file "remote/source/path")

To link one remote file to another remote file: (remote-file session "remote/path" :link "remote/source/path")

To download a url to a remote file: (remote-file session "remote/path" :url "http://a.com/path")

If a url to a md5 file is also available, then it can be specified to prevent unnecessary downloads and to verify the download. (remote-file session "remote/path" :url "http://a.com/path" :md5-url "http://a.com/path.md5")

If the md5 of the file to download, it can be specified to prevent unnecessary downloads and to verify the download. (remote-file session "remote/path" :url "http://a.com/path" :md5 "6de9439834c9147569741d3c9c9fc010")

Content can also be copied from a blobstore. (remote-file session "remote/path" :blob {:container "container" :path "blob"})

set-force-overwrite

[flag]

Globally force installation of new files, even if content on node has changed.

set-install-new-files

[flag]

Set boolean flag to control installation of new files

transfer-file

[session local-path remote-path {:as options}]

Function to transfer a local file.

version-options

A vector of options for controlling versions. Can be used for option forwarding when calling remote-file from other crates.

with-remote-file

[session f path & args]

Function to call f with a local copy of the sessioned remote path. f should be a function taking [session local-path & _], where local-path will be a File with a copy of the remote file (which will be unlinked after calling f.