Download assets from a Github Release.
- Add tests
N/A
gh_assets_github_token
| str : Github Personal Access Token to access private repositories (checkGH_TOKEN
env variable if unset).gh_assets_github_api_version
| str : Github API version to use (default:2022-11-28
: ).gh_assets_src
| {} : Object containing the source repository and release to download assets from.repo
| str : Repository nameowner
| str : Repository ownertag
| str : Release tag -latest
(get latest release) or specific tag setdownload_sources_tarball
| bool : Download sources tarball (default:false
)download_assets
| bool : Download assets (default:true
) - useful to download sources onlydownload_all_assets
| bool : Download all assets (default:false
) - iftrue
, all assets will be downloadedasset_name
| str : Asset name to download (default: undefined) - if not set anddownload_all_assets
isfalse
, the first asset will be downloaded
gh_assets_dst
| {} : Object containing the destination directory to download assets to.path
| str : Directory to download assets to (default:/tmp
)asset_name
| str : File name for downloaded asset (default undefined) - if not set anddownload_all_assets
isfalse
, asset keeps its original nametarball_name
| str : File name for downloaded sources tarball (default undefined) - if not set, tarball keeps its original name (<repo-name>-<tag-name>
)owner
| str : Owner of the directory (optional)group
| str : Group of the directory (optional)mode
| str : Mode of the directory (optional)
N/A
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- role: weytop.infrastructure.gh_assets
gh_assets_github_token: "your_github_token"
gh_assets_src:
owner: "grafana"
repo: "mimir"
asset_name: "mimir-linux-amd64-sha-256"
GPL-3.0-or-later
This role was created in 2024 by ThysTips.