{"id":28625497,"url":"https://github.com/querateam/ansible-github","last_synced_at":"2025-10-04T01:38:50.187Z","repository":{"id":110396147,"uuid":"576597850","full_name":"QueraTeam/ansible-github","owner":"QueraTeam","description":"Ansible module to download and install assets from Github releases page.","archived":false,"fork":false,"pushed_at":"2025-05-13T11:15:10.000Z","size":51,"stargazers_count":13,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-12T08:11:30.902Z","etag":null,"topics":["ansible","ansible-module","github","github-releases"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QueraTeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2022-12-10T11:05:38.000Z","updated_at":"2025-05-13T11:15:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"e88acd4e-2523-46be-a848-04bb2d3efeff","html_url":"https://github.com/QueraTeam/ansible-github","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/QueraTeam/ansible-github","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueraTeam%2Fansible-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueraTeam%2Fansible-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueraTeam%2Fansible-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueraTeam%2Fansible-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QueraTeam","download_url":"https://codeload.github.com/QueraTeam/ansible-github/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QueraTeam%2Fansible-github/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278254471,"owners_count":25956598,"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","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ansible","ansible-module","github","github-releases"],"created_at":"2025-06-12T08:10:48.306Z","updated_at":"2025-10-04T01:38:50.148Z","avatar_url":"https://github.com/QueraTeam.png","language":"Python","readme":"# Ansible Collection - quera.github\n\nDownload and install assets from Github releases page.\n\n**Note:** Do not modify README.md directly.\nIt is auto-generated by `python generate_readme` in `readme_src` folder.\n\n## Installation\n\n### Install the `quera.github` collection from Github\n\n```shell\nansible-galaxy collection install git+https://github.com/QueraTeam/ansible-github.git\n```\n\n### Install the `install_from_github` module as a local custom module\n\nAlternatively, you may manually install the `install_from_github` module itself as a [local custom module](https://docs.ansible.com/ansible/latest/dev_guide/developing_locally.html) instead of installing the module through the `quera.github` Ansible collection. However, it is recommended to use `quera.github` collection unless you have a good reason not to. Here are the commands to install the `install_from_github` module as a local custom module:\n\n```shell\n# Create the user custom module directory\nmkdir -p ~/.ansible/plugins/modules\n\n# Install the install_from_github module into the user custom module directory\ncurl -o ~/.ansible/plugins/modules/install_from_github.py https://raw.githubusercontent.com/QueraTeam/ansible-github/main/plugins/modules/install_from_github.py\n```\n\n## Ansible Module - quera.github.install_from_github\n\n\nThis module can be used to select a release from a Github repository, select an asset from that release based on OS and CPU architecture, download the asset, and install files/directories from the asset.\n\n\n\n### Options\n\n|     Parameter      |                      Type                      |                                                                                                                                                                                                                                                                                           Description                                                                                                                                                                                                                                                                                           |\n|--------------------|------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n|asset_arch_mapping  | Type: `dict`                                   |If the repo uses non-standard strings to specify CPU architecture, you can define a custom mapping between those and standard architectures. For example, if some repo uses `64` instead of `x86_64` or `amd64`, you can set this option to `amd64: \"64\"` or `x86_64: \"64\"`.                                                                                                                                                                                                                                                                                                                     |\n|asset_archive_format| Type: `str`                                    |If the asset is an archive, you can specify the archive format for unpacking. The format should be one of the formats supported by Python's `shutil.unpack_archive()` function: `zip`, `tar`, `gztar`, `bztar`, or `xztar`. If not provided, the module will use the filename extension to guess the format.                                                                                                                                                                                                                                                                                     |\n|asset_regex         | Type: `str` \u003cbr/\u003e**Required**                  |A regex for selecting an asset (file name) from all the assets of selected release. If there are multiple assets for different OSes and CPU architectures, you don't need to specify OS (darwin, linux, ...) and architecture (x86_64, amd64, aarch64, arm64, ...) in your regex (just write `.*` in place of them). This module tries to narrow down assets based on the system's OS and CPU architecture.                                                                                                                                                                                      |\n|move_rules          | Type: `list` \u003cbr/\u003e**Required**                 |You need to specify how individual items from an asset should be moved to the system. Privide a list of rules. Each rule should specify `src_regex` and `dst`, and could specify `mode`, `owner`, `group`. An asset can be a single file, or an archive (`.zip`, `.tar.gz`, ...). When asset is an archive, you select by `src_regex` some paths (directories or files) relative to archive root, and they will move to `dst`. Even if the asset is just a single file (not an archive), you should specify a rule to move that file (`src_regex` can be any regex mathing file name, e.g. `.*`).|\n|repo                | Type: `str` \u003cbr/\u003e**Required**                  |The name of the repository in the format `user_or_org/repo_name`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\n|tag                 | Type: `str`  \u003cbr/\u003eDefault: `latest`            |The tag to select from releases page. The default (`latest`) means the most recent non-prerelease, non-draft release.                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |\n|version_command     | Type: `str`                                    |The command to get the currently installed version. (e.g. `some_command --version`) If the output of this command matches the selected asset, downloading and installing the asset is skipped.                                                                                                                                                                                                                                                                                                                                                                                                   |\n|version_file        | Type: `path`                                   |Path to a file containing the version of currently installed version. The module reads the version from this file instead of `version_command` before installing (to skip download if the desired version is installed) and writes the installed version to this file after successful installation. This is useful for non-executable assets which don't have any `--version` command (e.g. fonts, ...). If you pass `version_file`, you can't pass `version_command` or `version_regex` options.                                                                                               |\n|version_regex       | Type: `str`  \u003cbr/\u003eDefault: `\\d+\\.\\d+(?:\\.\\d+)?`|A regex for extracting version from the output of `version_command` or tag name. The default is to match 2 or 3 numbers joined by `.`. E.g. 1.12.7 or 1.12                                                                                                                                                                                                                                                                                                                                                                                                                                       |\n\n\n\n### Examples\n\n```yaml\n\n- name: install latest version of lego (ACME client)\n  quera.github.install_from_github:\n    repo: go-acme/lego\n    asset_regex: lego.*\\.tar\\.gz\n    version_command: lego --version\n    move_rules:\n      - src_regex: lego\n        dst: /usr/local/bin\n        mode: 0755\n\n- name: install a specific version of sentry-cli\n  quera.github.install_from_github:\n    repo: getsentry/sentry-cli\n    tag: \"2.8.1\"\n    asset_regex: sentry-cli-.*\n    version_command: sentry-cli --version\n    move_rules:\n      - src_regex: sentry-cli-.*\n        dst: /usr/local/bin/sentry-cli\n        mode: 0755\n\n- name: install both executable and data\n  quera.github.install_from_github:\n    repo: example/example\n    asset_regex: example-.*\\.zip\n    asset_arch_mapping:\n      amd64: \"64\"  # This repo indicates amd64 as example-64.zip instead of example-amd64.zip or example-x86_64.zip.\n    version_command: example --version\n    move_rules:\n      - src_regex: example\n        dst: /usr/local/bin\n        mode: 0755\n      - src_regex: .*\\.dat\n        dst: /usr/local/share/example\n        mode: 0644\n\n- name: install some data file (e.g. font, ...)\n  quera.github.install_from_github:\n    repo: example/example\n    asset_regex: exampledata.dat\n    version_file: /usr/local/share/example/exampledata.dat.version\n    move_rules:\n      - src_regex: exampledata.dat\n        dst: /usr/local/share/example\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquerateam%2Fansible-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquerateam%2Fansible-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquerateam%2Fansible-github/lists"}