githubreleases
Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x
- Puppet >= 5.0.0
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'dodevops-githubreleases', '4.1.0'
Learn more about managing modules with a PuppetfileDocumentation
dodevops/githubreleases
Table of Contents
- Description
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
Description
This puppet module downloads tar-, zipballs or assets from Github releases.
Assets can be filtered by Content type and/or file name.
Usage
To download a release from Github, use the defined type githubreleases_download like this:
githubreleases_download {
'/tmp/release.latest.head.tar.gz':
author => 'company',
repository => 'example'
}
This will download the latest (HEAD) version of the project "company/example" as a tarball an place it in /tmp/release.latest.head.tar.gz.
If the repository uses the Github release feature, the tarball of the latest (non-pre-release) release will be downloaded.
If the repository uses assets to offer binary files with each release, these can also be downloaded:
githubreleases_download {
'/tmp/release.0.0.2.asset.debian':
author => 'company',
repository => 'example',
release => '0.0.2',
asset => true,
asset_contenttype => 'application\/x-deb'
}
This will download a debian package of release 0.0.2 of the repository.
File names can be filtered as well:
githubreleases_download {
'/tmp/release.0.0.2.asset.exe':
author => 'company',
repository => 'example',
release => '0.0.2',
asset => true,
asset_filepattern => 'example.*\.exe'
}
This will download the first file matching the given filepattern.
All patterns are Regular Expressions.
This module also supports hiera. Just include the githubreleases-class and use the type like this:
githubreleases_download:
'/tmp/release.latest.head.fromhiera.tar.gz':
author: 'company'
repository: 'example'
Defaults for multiple resources can be set by configuring the githubreleases-class.
Using authentication
Github rate-limits access to its API. If you use this module in a test and massively download files using it, you better create a Github user and set the authentication parameters so that you will get a better rate.
Reference
Table of Contents
Classes
githubreleases
: Downloads release artifacts from Github
Resource types
githubreleases_download
: downloads release artifacts from Github
Classes
githubreleases
Downloads release artifacts from Github
Parameters
The following parameters are available in the githubreleases
class.
release
Data type: String
The release or tag to download
Default value: 'latest'
asset_filepattern
Data type: String
A RegExp filepattern that the requested assed must patch
Default value: '.*'
asset_contenttype
Data type: String
A RegExp pattern of the requested content type of the asset
Default value: '.*'
asset
Data type: Boolean
Request the download of an asset
Default value: false
asset_fallback
Data type: Boolean
If asset can't be found, download a source tar- or zipball instead
Default value: false
use_zip
Data type: Boolean
Use a zipball instead of a tarball when requesting non-asset artifacts
Default value: false
is_tag
Data type: Boolean
The given release is a tag
Default value: false
use_auth
Data type: Variant[Boolean, String]
Authenticate with the GitHub API to circumvent rate limiting
Default value: false
use_oauth
Data type: Variant[Boolean, String]
Use OAuth authentication instead of basic authentication.
Default value: false
author
Data type: Optional[String]
Github author of the requested release
Default value: undef
repository
Data type: Optional[String]
Github repository of the requested release
Default value: undef
username
Data type: Optional[String]
GitHub username to use
Default value: ''
password
Data type: Optional[String]
GitHub password to use
Default value: ''
Resource types
githubreleases_download
downloads release artifacts from Github
Properties
The following properties are available in the githubreleases_download
type.
ensure
Valid values: present, absent
The basic property that the resource should be in.
Default value: present
Parameters
The following parameters are available in the githubreleases_download
type.
target
Target path to use (defaults to name of the ressource)
release
The release or tag to download
Default value: latest
asset_filepattern
A RegExp filepattern that the requested assed must patch
Default value: .*
asset_contenttype
A RegExp pattern of the requested content type of the asset
Default value: .*
asset
Valid values: true
, false
, yes, no
Request the download of an asset
Default value: false
asset_fallback
Valid values: true
, false
, yes, no
If asset can\'t be found, download a source tar- or zipball instead
Default value: false
use_zip
Valid values: true
, false
, yes, no
Use a zipball instead of a tarball when requesting non-asset artifacts
Default value: false
is_tag
Valid values: true
, false
, yes, no
The given release is a tag
Default value: false
use_auth
Valid values: true
, false
, yes, no
Authenticate with the GitHub API to circumvent rate limiting
Default value: false
use_oauth
Valid values: true
, false
, yes, no
Use OAuth authentication instead of basic authentication.
Default value: false
author
Github author of the requested release
repository
Github repository of the requested release
username
GitHub username to use
Default value: ''
password
GitHub password to use
Default value: ''