Uploading artifacts#
You can define artifacts to create or copy files to target
instances:
cluster_vars:
artifacts:
- type: path
path: /some/target/path
state: directory
owner: root
group: root
mode: "0755"
- type: file
src: /host/path/to/file
dest: /target/path/to/file
owner: root
group: root
mode: "0644"
- type: archive
src: example.tar.gz
dest: /some/target/path
- type: directory
src: /host/path/a/
dest: /target/path/b/
The following types are supported:
Use
pathto create or remove and change the ownership or mode of files and directories (takes the same parameters as Ansible’sfilemodule, which it uses internally)Use
fileto copy a file from the controller and set the ownership and mode (usescopy)Use
archiveto extract files from an archive to a specified location (usesunarchive)Use
directoryto rsync a directory from the controller to target instances (usessynchronize)
The example shows one entry for each of the above artifact types, but you can use these or any other parameters that the corresponding Ansible module accepts.
Copying files and directories to target instances is a common-enough need that this feature provides a convenient shortcut you can use instead of writing a TPA hooks .