{"id":15013960,"url":"https://github.com/voxpupuli/puppet-archive","last_synced_at":"2025-05-14T11:13:11.907Z","repository":{"id":20409045,"uuid":"23685242","full_name":"voxpupuli/puppet-archive","owner":"voxpupuli","description":"Compressed archive file download and extraction with native types/providers for Windows and Unix","archived":false,"fork":false,"pushed_at":"2025-03-19T19:07:17.000Z","size":1029,"stargazers_count":59,"open_issues_count":62,"forks_count":176,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-05-01T02:28:01.713Z","etag":null,"topics":["archlinux-puppet-module","centos-puppet-module","debian-puppet-module","hacktoberfest","linux-puppet-module","oraclelinux-puppet-module","puppet","redhat-puppet-module","scientific-puppet-module","sles-puppet-module","ubuntu-puppet-module","windows-puppet-module"],"latest_commit_sha":null,"homepage":"https://forge.puppet.com/puppet/archive","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voxpupuli.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"vox-pupuli","github":"voxpupuli"}},"created_at":"2014-09-05T00:56:20.000Z","updated_at":"2025-03-23T11:29:29.000Z","dependencies_parsed_at":"2023-12-19T08:39:08.990Z","dependency_job_id":"d9e92c29-2f10-43ed-8f04-ce21d0cf8702","html_url":"https://github.com/voxpupuli/puppet-archive","commit_stats":{"total_commits":525,"total_committers":94,"mean_commits":5.585106382978723,"dds":0.699047619047619,"last_synced_commit":"63474f6709e4c44b1b4c6852b32335f34df32877"},"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-archive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-archive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-archive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpupuli%2Fpuppet-archive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voxpupuli","download_url":"https://codeload.github.com/voxpupuli/puppet-archive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252495456,"owners_count":21757273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["archlinux-puppet-module","centos-puppet-module","debian-puppet-module","hacktoberfest","linux-puppet-module","oraclelinux-puppet-module","puppet","redhat-puppet-module","scientific-puppet-module","sles-puppet-module","ubuntu-puppet-module","windows-puppet-module"],"created_at":"2024-09-24T19:45:00.247Z","updated_at":"2025-05-14T11:13:11.877Z","avatar_url":"https://github.com/voxpupuli.png","language":"Ruby","funding_links":["https://opencollective.com/vox-pupuli","https://github.com/sponsors/voxpupuli"],"categories":[],"sub_categories":[],"readme":"# Puppet Archive\n\n[![License](https://img.shields.io/github/license/voxpupuli/puppet-archive.svg)](https://github.com/voxpupuli/puppet-archive/blob/master/LICENSE)\n[![Build Status](https://travis-ci.org/voxpupuli/puppet-archive.png?branch=master)](https://travis-ci.org/voxpupuli/puppet-archive)\n[![Code Coverage](https://coveralls.io/repos/github/voxpupuli/puppet-archive/badge.svg?branch=master)](https://coveralls.io/github/voxpupuli/puppet-archive)\n[![Puppet Forge](https://img.shields.io/puppetforge/v/puppet/archive.svg)](https://forge.puppetlabs.com/puppet/archive)\n[![Puppet Forge - downloads](https://img.shields.io/puppetforge/dt/puppet/archive.svg)](https://forge.puppetlabs.com/puppet/archive)\n[![Puppet Forge - endorsement](https://img.shields.io/puppetforge/e/puppet/archive.svg)](https://forge.puppetlabs.com/puppet/archive)\n[![Puppet Forge - scores](https://img.shields.io/puppetforge/f/puppet/archive.svg)](https://forge.puppetlabs.com/puppet/archive)\n[![Camptocamp compatible](https://img.shields.io/badge/camptocamp-compatible-orange.svg)](https://forge.puppet.com/camptocamp/archive)\n\n## Table of Contents\n\n1. [Overview](#overview)\n1. [Module Description](#module-description)\n1. [Setup](#setup)\n1. [Usage](#usage)\n   * [Example](#usage-example)\n   * [Puppet URL](#puppet-url)\n   * [File permission](#file-permission)\n   * [Network files](#network-files)\n   * [Extract customization](#extract-customization)\n   * [S3 Bucket](#s3-bucket)\n   * [GS Bucket](#gs-bucket)\n   * [Migrating from puppet-staging](#migrating-from-puppet-staging)\n1. [Reference](#reference)\n1. [Development](#development)\n\n## Overview\n\nThis module manages download, deployment, and cleanup of archive files.\n\n## Module Description\n\nThis module uses types and providers to download and manage compress files,\nwith optional lifecycle functionality such as checksum, extraction, and\ncleanup. The benefits over existing modules such as\n[puppet-staging](https://github.com/voxpupuli/puppet-staging):\n\n* Implemented via types and provider instead of exec resource.\n* Follows 302 redirect and propagate download failure.\n* Optional checksum verification of archive files.\n* Automatic dependency to parent directory.\n* Support Windows file extraction via 7zip or PowerShell (Zip file only).\n* Able to cleanup archive files after extraction.\n\nThis module is compatible with [camptocamp/archive](https://forge.puppet.com/camptocamp/archive).\nFor this it provides compatibility shims.\n\n## Setup\n\nOn Windows 7zip is required to extract all archives except zip files which will\nbe extracted with PowerShell if 7zip is not available (requires\n`System.IO.Compression.FileSystem`/Windows 2012+). Windows clients can install\n7zip via `include 'archive'`. On posix systems, curl is the default provider.\nThe default provider can be overwritten by configuring resource defaults in\nsite.pp:\n\n```puppet\nArchive {\n  provider =\u003e 'ruby',\n}\n```\n\nUsers of the module are responsible for archive package dependencies, for\nalternative providers and all extraction utilities such as tar, gunzip, bunzip:\n\n```puppet\nif $facts['osfamily'] != 'windows' {\n  package { 'wget':\n    ensure =\u003e present,\n  }\n\n  package { 'bunzip':\n    ensure =\u003e present,\n  }\n\n  Archive {\n    provider =\u003e 'wget',\n    require  =\u003e Package['wget', 'bunzip'],\n  }\n}\n```\n\n## Usage\n\nArchive module dependencies are managed by the `archive` class. This is only\nrequired on Windows. By default 7zip is installed via chocolatey, but\nthe MSI package can be installed instead:\n\n```puppet\nclass { 'archive':\n  seven_zip_name     =\u003e '7-Zip 9.20 (x64 edition)',\n  seven_zip_source   =\u003e 'C:/Windows/Temp/7z920-x64.msi',\n  seven_zip_provider =\u003e 'windows',\n}\n```\n\nTo automatically load archives as part of this class you can define the\n`archives` parameter.\n\n```puppet\nclass { 'archive':\n  archives =\u003e { '/tmp/jta-1.1.jar' =\u003e {\n                  'ensure' =\u003e 'present',\n                  'source'  =\u003e 'http://central.maven.org/maven2/javax/transaction/jta/1.1/jta-1.1.jar',\n                  }, }\n}\n```\n\n### Usage Example\n\nSimple example that downloads from web server:\n\n```puppet\narchive { '/tmp/vagrant.deb':\n  ensure =\u003e present,\n  source =\u003e 'https://releases.hashicorp.com/vagrant/2.2.3/vagrant_2.2.3_x86_64.deb',\n  user   =\u003e 0,\n  group  =\u003e 0,\n}\n```\n\nMore complex example :\n\n```puppet\ninclude 'archive' # NOTE: optional for posix platforms\n\narchive { '/tmp/jta-1.1.jar':\n  ensure        =\u003e present,\n  extract       =\u003e true,\n  extract_path  =\u003e '/tmp',\n  source        =\u003e 'http://central.maven.org/maven2/javax/transaction/jta/1.1/jta-1.1.jar',\n  checksum      =\u003e '2ca09f0b36ca7d71b762e14ea2ff09d5eac57558',\n  checksum_type =\u003e sha1,\n  creates       =\u003e '/tmp/javax',\n  cleanup       =\u003e true,\n}\n\narchive { '/tmp/test100k.db':\n  source   =\u003e 'ftp://ftp.otenet.gr/test100k.db',\n  username =\u003e 'speedtest',\n  password =\u003e 'speedtest',\n}\n```\n\nIf you want to extract a `.tar.gz` file:\n\n```puppet\n$install_path        = '/opt/wso2'\n$package_name        = 'wso2esb'\n$package_ensure      = '4.9.0'\n$repository_url      = 'http://company.com/repository/wso2'\n$archive_name        = \"${package_name}-${package_ensure}.tgz\"\n$wso2_package_source = \"${repository_url}/${archive_name}\"\n\narchive { $archive_name:\n  path         =\u003e \"/tmp/${archive_name}\",\n  source       =\u003e $wso2_package_source,\n  extract      =\u003e true,\n  extract_path =\u003e $install_path,\n  creates      =\u003e \"${install_path}/${package_name}-${package_ensure}\",\n  cleanup      =\u003e true,\n  require      =\u003e File['wso2_appdir'],\n}\n```\n\n### Puppet URL\n\nSince march 2017, the Archive type also supports puppet URLs. Here is an example\nof how to use this:\n\n```puppet\n\narchive { '/home/myuser/help':\n  source        =\u003e 'puppet:///modules/profile/help.tar.gz',\n  extract       =\u003e true,\n  extract_path  =\u003e $homedir,\n  creates       =\u003e \"${homedir}/help\" #directory inside tgz\n}\n```\n\n### File permission\n\nWhen extracting files as non-root user, either ensure the target directory\nexists with the appropriate permission (see [tomcat.pp](examples/tomcat.pp) for\nfull working example):\n\n```puppet\n$dirname = 'apache-tomcat-9.0.0.M3'\n$filename = \"${dirname}.zip\"\n$install_path = \"/opt/${dirname}\"\n\nfile { $install_path:\n  ensure =\u003e directory,\n  owner  =\u003e 'tomcat',\n  group  =\u003e 'tomcat',\n  mode   =\u003e '0755',\n}\n\narchive { $filename:\n  path          =\u003e \"/tmp/${filename}\",\n  source        =\u003e 'http://www-eu.apache.org/dist/tomcat/tomcat-9/v9.0.0.M3/bin/apache-tomcat-9.0.0.M3.zip',\n  checksum      =\u003e 'f2aaf16f5e421b97513c502c03c117fab6569076',\n  checksum_type =\u003e sha1,\n  extract       =\u003e true,\n  extract_path  =\u003e '/opt',\n  creates       =\u003e \"${install_path}/bin\",\n  cleanup       =\u003e true,\n  user          =\u003e 'tomcat',\n  group         =\u003e 'tomcat',\n  require       =\u003e File[$install_path],\n}\n```\n\nor use an subscribing exec to chmod the directory afterwards:\n\n```puppet\n$dirname = 'apache-tomcat-9.0.0.M3'\n$filename = \"${dirname}.zip\"\n$install_path = \"/opt/${dirname}\"\n\nfile { '/opt/tomcat':\n  ensure =\u003e 'link',\n  target =\u003e $install_path\n}\n\narchive { $filename:\n  path          =\u003e \"/tmp/${filename}\",\n  source        =\u003e \"http://www-eu.apache.org/dist/tomcat/tomcat-9/v9.0.0.M3/bin/apache-tomcat-9.0.0.M3.zip\",\n  checksum      =\u003e 'f2aaf16f5e421b97513c502c03c117fab6569076',\n  checksum_type =\u003e sha1,\n  extract       =\u003e true,\n  extract_path  =\u003e '/opt',\n  creates       =\u003e \"${install_path}/bin\",\n  cleanup       =\u003e true,\n  require       =\u003e File[$install_path],\n}\n\nexec { 'tomcat permission':\n  command   =\u003e \"chown tomcat:tomcat $install_path\",\n  path      =\u003e $path,\n  subscribe =\u003e Archive[$filename],\n}\n```\n\n### Network files\n\nFor large binary files that needs to be extracted locally, instead of copying\nthe file from the network fileshare, simply set the file path to be the same as\nthe source and archive will use the network file location:\n\n```puppet\narchive { '/nfs/repo/software.zip':\n  source        =\u003e '/nfs/repo/software.zip'\n  extract       =\u003e true,\n  extract_path  =\u003e '/opt',\n  checksum_type =\u003e none,   # typically unecessary\n  cleanup       =\u003e false,  # keep the file on the server\n}\n```\n\n### Extract Customization\n\nThe `extract_flags` or `extract_command` parameters can be used to override the\ndefault extraction command/flag (defaults are specified in\n[achive.rb](lib/puppet_x/bodeco/archive.rb)).\n\n```puppet\n# tar striping directories:\narchive { '/var/lib/kafka/kafka_2.10-0.8.2.1.tgz':\n  ensure          =\u003e present,\n  extract         =\u003e true,\n  extract_command =\u003e 'tar xfz %s --strip-components=1',\n  extract_path    =\u003e '/opt/kafka_2.10-0.8.2.1',\n  cleanup         =\u003e true,\n  creates         =\u003e '/opt/kafka_2.10-0.8.2.1/config',\n}\n\n# zip freshen existing files (zip -of %s instead of zip -o %s):\narchive { '/var/lib/example.zip':\n  extract       =\u003e true,\n  extract_path  =\u003e '/opt',\n  extract_flags =\u003e '-of',\n  cleanup       =\u003e true,\n  subscribe     =\u003e ...,\n}\n```\n\n### S3 bucket\n\nS3 support is implemented via the [AWS CLI](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html).\nOn non-Windows systems, the `archive` class will install this dependency when\nthe `aws_cli_install` parameter is set to `true`:\n\n```puppet\nclass { 'archive':\n  aws_cli_install =\u003e true,\n}\n\n# See AWS cli guide for credential and configuration settings:\n# http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html\nfile { '/root/.aws/credentials':\n  ensure =\u003e file,\n  ...\n}\nfile { '/root/.aws/config':\n  ensure =\u003e file,\n  ...\n}\n\narchive { '/tmp/gravatar.png':\n  ensure =\u003e present,\n  source =\u003e 's3://bodecoio/gravatar.png',\n}\n```\n\nNOTE: Alternative s3 provider support can be implemented by overriding the\n[s3_download method](lib/puppet/provider/archive/ruby.rb):\n\n### GS bucket\n\nGSUtil support is implemented via the [GSUtil Package](https://cloud.google.com/storage/docs/gsutil).\nOn non-Windows systems, the `archive` class will install this dependency when\nthe `gsutil_install` parameter is set to `true`:\n\n```puppet\nclass { 'archive':\n  gsutil_install =\u003e true,\n}\n\n# See Google Cloud SDK cli guide for credential and configuration settings:\n# https://cloud.google.com/storage/docs/quickstart-gsutil\n\narchive { '/tmp/gravatar.png':\n  ensure =\u003e present,\n  source =\u003e 'gs://bodecoio/gravatar.png',\n}\n```\n\n### Passing headers\n\nSometimes headers need to be passed to source. This can be accomplished\nusing `headers` parameter:\n\n```puppet\narchive { '/tmp/slack-desktop-4.28.184-amd64.deb':\n  ensure        =\u003e present,\n  extract       =\u003e true,\n  extract_path  =\u003e '/tmp',\n  source        =\u003e 'https://downloads.slack-edge.com/releases/linux/4.28.184/prod/x64/slack-desktop-4.28.184-amd64.deb',\n  checksum      =\u003e 'e5d63dc6bd112d40c97f210af4c5f66444d4d5e8',\n  checksum_type =\u003e sha1,\n  headers       =\u003e ['Authorization: OAuth ABC123']\n  creates       =\u003e '/usr/local/bin/slack',\n  cleanup       =\u003e true,\n}\n```\n\n### Download customizations\n\nIn some cases you may need custom flags for curl/wget/s3/gsutil which can be\nsupplied via `download_options`. Since this parameter is provider specific,\nbeware of the order of defaults:\n\n* s3:// files accepts aws cli options\n\n  ```puppet\n  archive { '/tmp/gravatar.png':\n    ensure           =\u003e present,\n    source           =\u003e 's3://bodecoio/gravatar.png',\n    download_options =\u003e ['--region', 'eu-central-1'],\n  }\n  ```\n\n* puppet `provider` override:\n\n  ```puppet\n  archive { '/tmp/jta-1.1.jar':\n    ensure           =\u003e present,\n    source           =\u003e 'http://central.maven.org/maven2/javax/transaction/jta/1.1/jta-1.1.jar',\n    provider         =\u003e 'wget',\n    download_options =\u003e '--continue',\n  }\n  ```\n\n* Linux default provider is `curl`, and Windows default is `ruby` (no effect).\n\nThis option can also be applied globally to address issues for specific OS:\n\n```puppet\nif $facts['osfamily'] != 'RedHat' {\n  Archive {\n    download_options =\u003e '--tlsv1',\n  }\n}\n```\n\n### Migrating from puppet-staging\n\nIt is recommended to use puppet-archive instead of puppet-staging.\nUsers wishing to migrate may find the following examples useful.\n\n#### puppet-staging (without extraction)\n\n```puppet\nclass { 'staging':\n  path  =\u003e '/tmp/staging',\n}\n\nstaging::file { 'master.zip':\n  source =\u003e 'https://github.com/voxpupuli/puppet-archive/archive/master.zip',\n}\n```\n\n#### puppet-archive (without extraction)\n\n```puppet\narchive { '/tmp/staging/master.zip':\n  source =\u003e 'https://github.com/voxpupuli/puppet-archive/archive/master.zip',\n}\n```\n\n#### puppet-staging (with zip file extraction)\n\n```puppet\nclass { 'staging':\n  path  =\u003e '/tmp/staging',\n}\n\nstaging::file { 'master.zip':\n  source  =\u003e 'https://github.com/voxpupuli/puppet-archive/archive/master.zip',\n} -\u003e\nstaging::extract { 'master.zip':\n  target  =\u003e '/tmp/staging/master.zip',\n  creates =\u003e '/tmp/staging/puppet-archive-master',\n}\n```\n\n#### puppet-archive (with zip file extraction)\n\n```puppet\narchive { '/tmp/staging/master.zip':\n  source       =\u003e 'https://github.com/voxpupuli/puppet-archive/archive/master.zip',\n  extract      =\u003e true,\n  extract_path =\u003e '/tmp/staging',\n  creates      =\u003e '/tmp/staging/puppet-archive-master',\n  cleanup      =\u003e false,\n}\n```\n\n## Reference\n\n### Classes\n\n* `archive`: install 7zip package (Windows only) and aws cli or gsutil for s3/gs support.\n  It also permits passing an `archives` argument to generate `archive` resources.\n* `archive::staging`: install package dependencies and creates staging directory\n  for backwards compatibility. Use the archive class instead if you do not need\n  the staging directory.\n\n### Define Resources\n\n* `archive::artifactory`: archive wrapper for [JFrog Artifactory](http://www.jfrog.com/open-source/#os-arti)\n  files with checksum.\n* `archive::go`: archive wrapper for [GO Continuous Delivery](http://www.go.cd/)\n  files with checksum.\n* `archive::nexus`: archive wrapper for [Sonatype Nexus](http://www.sonatype.org/nexus/)\n  files with checksum.\n* `archive::download`: archive wrapper and compatibility shim for [camptocamp/archive](https://forge.puppet.com/camptocamp/archive).\n  This is considered private API, as it has to change with camptocamp/archive.\n  For this reason it will remain undocumented, and removed when no longer needed\n  . We suggest not using it directly. Instead please consider migrating to\n  archive itself where possible.\n\n### Resources\n\n#### Archive\n\n* `ensure`: whether archive file should be present/absent (default: present)\n* `path`: namevar, archive file fully qualified file path.\n* `filename`: archive file name (derived from path).\n* `source`: archive file source, supports http|https|ftp|file|s3|gs uri.\n* `headers`: array of headers to pass source, like an authentication token\n* `username`: username to download source file.\n* `password`: password to download source file.\n* `allow_insecure`: Ignore HTTPS certificate errors (true|false). (default: false)\n* `cookie`: archive file download cookie.\n* `checksum_type`: archive file checksum type (none|md5|sha1|sha2|sha256|sha384|\n  sha512). (default: none)\n* `checksum`: archive file checksum (match checksum_type)\n* `checksum_url`: archive file checksum source (instead of specify checksum)\n* `checksum_verify`: whether checksum will be verified (true|false). (default: true)\n* `extract`: whether archive will be extracted after download (true|false).\n  (default: false)\n* `extract_path`: target folder path to extract archive.\n* `extract_command`: custom extraction command ('tar xvf example.tar.gz'), also\n   support sprintf format ('tar xvf %s') which will be processed with the filename:\n   sprintf('tar xvf %s', filename)\n* `temp_dir`: Specify an alternative temporary directory to use for copying files,\n   if unset then the operating system default will be used.\n* `extract_flags`: custom extraction options, this replaces the default flags.\n  A string such as 'xvf' for a tar file would replace the default xf flag. A\n  hash is useful when custom flags are needed for different platforms. {'tar'\n  =\u003e 'xzf', '7z' =\u003e 'x -aot'}.\n* `user`: extract command user (using this option will configure the archive\n  file permission to 0644 so the user can read the file).\n* `group`: extract command group (using this option will configure the archive\n  file permission to 0644 so the user can read the file).\n* `cleanup`: whether archive file will be removed after extraction (true|false).\n  (default: true)\n* `creates`: if file/directory exists, will not download/extract archive. If\n  `extract` and `cleanup` are both `true`, this should be set to prevent Puppet\n  from re-downloading and re-extracting the archive every run.\n* `proxy_server`: specify a proxy server, with port number if needed. ie:\n  `https://example.com:8080`.\n* `proxy_type`: proxy server type (none|http|https|ftp)\n\n#### Archive::Artifactory\n\n* `path`: fully qualified filepath for the download the file or use\n  archive_path and only supply filename. (namevar).\n* `ensure`: ensure the file is present/absent.\n* `url`: artifactory download url filepath. NOTE: replaces server, port,\n  url_path parameters.\n* `server`: artifactory server name (deprecated).\n* `port`: artifactory server port (deprecated).\n* `url_path`: artifactory file path\n  `http:://{server}:{port}/artifactory/{url_path}` (deprecated).\n* `owner`: file owner (see archive params for defaults).\n* `group`: file group (see archive params for defaults).\n* `mode`: file mode (see archive params for defaults).\n* `archive_path`: the parent directory of local filepath.\n* `extract`: whether to extract the files (true/false).\n* `creates`: the file created when the archive is extracted (true/false).\n* `cleanup`: remove archive file after file extraction (true/false).\n* `headers`: array of headers to pass source\n\n#### Archive::Artifactory Example\n\n* retrieve gradle without authentication\n\n  ```puppet\n  $dirname = 'gradle-1.0-milestone-4-20110723151213+0300'\n  $filename = \"${dirname}-bin.zip\"\n\n  archive::artifactory { $filename:\n    archive_path =\u003e '/tmp',\n    url          =\u003e \"http://repo.jfrog.org/artifactory/distributions/org/gradle/${filename}\",\n    extract      =\u003e true,\n    extract_path =\u003e '/opt',\n    creates      =\u003e \"/opt/${dirname}\",\n    cleanup      =\u003e true,\n  }\n\n  file { '/opt/gradle':\n    ensure =\u003e link,\n    target =\u003e \"/opt/${dirname}\",\n  }\n  ```\n\n* retrieve gradle with api token:\n\n  ```puppet\n  $dirname = 'gradle-1.0-milestone-4-20110723151213+0300'\n  $filename = \"${dirname}-bin.zip\"\n\n  archive::artifactory { $filename:\n    archive_path =\u003e '/tmp',\n    url          =\u003e \"http://repo.jfrog.org/artifactory/distributions/org/gradle/${filename}\",\n    headers      =\u003e ['X-JFrog-Art-Api: ABC123'],\n    extract      =\u003e true,\n    extract_path =\u003e '/opt',\n    creates      =\u003e \"/opt/${dirname}\",\n    cleanup      =\u003e true,\n  }\n\n  file { '/opt/gradle':\n    ensure =\u003e link,\n    target =\u003e \"/opt/${dirname}\",\n  }\n  ```\n\n* setup resource defaults\n\n  ```puppet\n  $artifactory_authentication = lookup('jfrog_token')\n\n  Archive::Artifactory {\n    headers =\u003e [\"X-JFrog-Art-Api: ${artifactory_authentication}\"],\n  }\n  ```\n\n#### Archive::Nexus\n\n#### Archive::Nexus Example\n\n```puppet\narchive::nexus { '/tmp/jtstand-ui-0.98.jar':\n  url        =\u003e 'https://oss.sonatype.org',\n  gav        =\u003e 'org.codehaus.jtstand:jtstand-ui:0.98',\n  repository =\u003e 'codehaus-releases',\n  packaging  =\u003e 'jar',\n  extract    =\u003e false,\n}\n```\n\n## Development\n\nWe highly welcome new contributions to this module, especially those that\ninclude documentation, and rspec tests ;) but will happily guide you through\nthe process, so, yes, please submit that pull request!\n\nNote: If you are writing a dependent module that include specs in it, you will\nneed to set the puppetversion fact in your puppet-rspec tests. You can do that\nby adding it to the default facts of your spec/spec_helper.rb:\n\n```ruby\nRSpec.configure do |c|\n  c.default_facts = { :puppetversion =\u003e Puppet.version }\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoxpupuli%2Fpuppet-archive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoxpupuli%2Fpuppet-archive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoxpupuli%2Fpuppet-archive/lists"}