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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| src | string | yes | Path to the archive file (local or remote path, or URL) | |
| dest | string | yes | Remote absolute path where the archive should be unpacked | |
| remote_src | bool | false | Set to yes to unpack an archive which already exists on the target | |
| creates | string | If specified absolute path exists, extraction will be skipped | ||
| list_files | bool | false | If set to true, return the list of files contained in the archive | |
| keep_newer | bool | false | Do not replace existing files that are newer than files from the archive | |
| exclude | list | List of files or directories to exclude from extraction | ||
| include | list | List of files or directories to extract from the archive (mutually exclusive with exclude) | ||
| extra_opts | list | Additional extraction options. Only –strip-components=N is supported; anything else is rejected | ||
| validate_certs | bool | true | Whether to validate SSL certificates when downloading from HTTPS URLs | |
| io_buffer_size | int | 65536 | Size of the buffer (in bytes) used when extracting files | |
| copy | bool | true | Deprecated in favor of remote_src | |
| decrypt | bool | true | Controls the auto-decryption of source files using vault | |
| mode | string | The permissions the resulting files or directories should have | ||
| owner | string | Name of the user that should own the files/directories | ||
| group | string | Name of the group that should own the files/directories | ||
| seuser | string | The user part of the SELinux file context | ||
| serole | string | The role part of the SELinux file context | ||
| setype | string | The type part of the SELinux file context | ||
| selevel | string | The level part of the SELinux file context | ||
| attributes | string | The attributes the resulting files should have | ||
| unsafe_writes | bool | false | Allow 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