troykinsella.archive
troykinsella.archive
An Ansible role for downloading and unpacking archive files, while checking their validity with checksums.
Role Variables
- archive_file_name: The name of the archive file.
- archive_file_mode: Optional. The file permission mode for the downloaded archive. Default is 644.
- archive_url: The full URL where the archive can be downloaded.
- archive_fetch_headers: Optional. HTTP headers to use when fetching the archive. Default is empty (""). Use the format "key:value,key:value".
- archive_checksum: The checksum that the fetched archive is expected to match.
- archive_checksum_algorithm: Optional. The algorithm for the checksum, like md5, sha1, or sha256. Default is sha256.
- archive_cache_path: Optional. The directory where the archive will be saved temporarily. Default is /usr/local/pkg.
- archive_destination_path: Optional. The directory where the contents of the archive will be unpacked. Default is /usr/local/.
- archive_extracted_file_name: The name of the main file or folder that will be extracted from the archive.
- archive_destination_file_name: Optional. This renames the extracted file to this name.
- archive_destination_link_name: Optional. Creates a symbolic link with this name pointing to the
archive_extracted_file_name
(orarchive_destination_file_name
if specified).
Example Playbook
- hosts: servers
roles:
- role: troykinsella.archive
archive_file_name: go1.5.3.linux-amd64.tar.gz
archive_file_mode: 0700
archive_url: https://storage.googleapis.com/golang/{{ archive_file_name }}
archive_checksum: 43afe0c5017e502630b1aea4d44b8a7f059bf60d7f29dfd58db454d4e4e0ae53
archive_checksum_algorithm: sha256
archive_cache_path: /usr/local/pkg
archive_destination_path: /usr/local/
archive_extracted_file_name: go
archive_destination_file_name: go1.5.3 # Rename the extracted file/directory
archive_destination_link_name: go # Create a link to the active version
Platforms
(Not tested)
- EL
- Fedora
- openSUSE
- Amazon
- Ubuntu
- Debian
License
MIT
Installa
ansible-galaxy install troykinsella.archive
Licenza
mit
Download
158
Proprietario
Staff Solutions Architect at @collectivei.