unarchive

Collection: builtin

Full Name: parallax.builtin.unarchive

Aliases: ansible.builtin.unarchive, unarchive

Synopsis

Unpack an archive, optionally copying it to the target first

Parameters

NameTypeRequiredDefaultDescription
srcstringyesPath to the archive file (local or remote path, or URL)
deststringyesRemote absolute path where the archive should be unpacked
remote_srcboolfalseSet to yes to unpack an archive which already exists on the target
createsstringIf specified absolute path exists, extraction will be skipped
list_filesboolfalseIf set to true, return the list of files contained in the archive
keep_newerboolfalseDo not replace existing files that are newer than files from the archive
excludelistList of files or directories to exclude from extraction
includelistList of files or directories to extract from the archive (mutually exclusive with exclude)
extra_optslistAdditional extraction options. Only –strip-components=N is supported; anything else is rejected
validate_certsbooltrueWhether to validate SSL certificates when downloading from HTTPS URLs
io_buffer_sizeint65536Size of the buffer (in bytes) used when extracting files
copybooltrueDeprecated in favor of remote_src
decryptbooltrueControls the auto-decryption of source files using vault
modestringThe permissions the resulting files or directories should have
ownerstringName of the user that should own the files/directories
groupstringName of the group that should own the files/directories
seuserstringThe user part of the SELinux file context
serolestringThe role part of the SELinux file context
setypestringThe type part of the SELinux file context
selevelstringThe level part of the SELinux file context
attributesstringThe attributes the resulting files should have
unsafe_writesboolfalseAllow unsafe file operations

Example

- name: Unpack the release into place
  unarchive:
    src: /tmp/app-1.4.2.tar.gz
    dest: /srv/app
    remote_src: true
    creates: /srv/app/VERSION