xanmanning.github_downloader
Ansible Role: github_downloader
This Ansible role helps you download binary files from a GitHub repository release to any location you choose.
Requirements
This role works with Ansible version 2.10.0 and higher, and is compatible with Linux and UNIX systems.
Disclaimer
If you encounter any issues, please create a GitHub issue. I work on this role during my free time, so I may not be able to fix problems quickly.
Role Variables
Here are the variables you can use. For more information, check defaults/main.yml.
| Variable | Short Description | Default Value | 
|---|---|---|
| github_download_packages | List of binaries to download. See the example below. | [] | 
| github_download_location | Where to download the files. | $HOME/bin | 
| github_download_pat_token | PAT Token for accessing the API | None | 
| github_download_hostname | GitHub hostname. | github.com | 
| github_download_api_hostname | GitHub API hostname. | api.github.com | 
Filename Templates
You can use these variables in filenames, and they will be replaced with values from Ansible facts.
| Variable | Description | Example | 
|---|---|---|
| %ARCH% | OS Architecture | amd64 | 
| %ARCHRAW% | OS Architecture (keeps x86_64asx86_64) | x86_64 | 
| %OS% | OS Family (in lowercase) | linux/darwin | 
| %OSCAPITALIZED% | OS Family (capitalized) | Linux/Darwin | 
| %VERSION% | Package Version | v1.20.0 | 
| %NVERSION% | Package Version (without vprefix) | 1.20.0 | 
Dependencies
This role does not depend on any other roles.
Example Playbook
Here’s an example playbook to create a list of users from GitHub:
- hosts: all
  become: true
  vars:
    github_download_packages:
      - name: package_name
        repo: owner/repo
        version: 1.0.2  # Can be 'latest'
        filename: package_name-%VERSION%-%OS%-%ARCH%.tar.gz  # See filename templates in README.md
        extracted_filename: package_name-%VERSION%
        command: package_name install
        command_become: false  # Do not become root for this command
  roles:
    - role: xanmanning.github_downloader
License
Author Information
Informazioni sul progetto
 Ansible Role to download binaries from Github
Installa
 ansible-galaxy install xanmanning.github_downloaderLicenza
 
            bsd-3-clause
          
Download
 
            158
          
Proprietario
 Deep in the lab...
