nioniosfr.github_release

Ansible Role: GitHub Release

This role is for installing a binary application that you can find on GitHub for Linux x86_64 systems.

Requirements

This role works with Debian and RHEL systems that run on x86_64 architecture.

You need to run this role on the remote machine, so it must have internet access.

Be careful with what packages you install, as this role is quite general.

Important: Always check the packages you want to install because there’s no way to verify the download checksum automatically.

Role Variables

Required:

ghr_org_name: # Name of a valid GitHub organization
ghr_app_name: # Name of a valid GitHub repository under that organization

Default:

ghr_app_version: "latest" # The latest released version found at: https://github.com/{{ ghr_org_name }}/{{ ghr_app_name }}/releases/

ghr_app_binary_dest: "/opt/{{ ghr_app_name }}" # Where to install the binary

ghr_app_cleanup_after: false # If true, it removes all downloaded files

ghr_app_configure_system_path: true # Whether to add the binary's directory to the system `PATH`
ghr_app_system_path_prepend: false # If true, it adds the binary's directory to the front of the `PATH`.

ghr_app_tmp_dir: # Temporary directory for the downloaded file

ghr_app_releases_url: # The URL for GitHub releases.
ghr_app_archive: # The name of the downloaded archive.

Dependencies

None

Example Playbook

Running this role multiple times may cause conflicts with variables.

It’s best to run one role for each host.

    - hosts: localhost
      roles:
        - role: nioniosfr.github_release
          vars:
            ghr_org_name: "digitalocean"
            ghr_app_name: "doctl"
            ghr_app_version: "1.18.0"
            ghr_app_tmp_dir: "/mnt/nfs_share/downloads" # Use a permanent location for downloads

    - hosts: localhost
      roles:
        - role: nioniosfr.github_release
          vars:
            ghr_org_name: "stedolan"
            ghr_app_name: "jq"
            ghr_app_version: "1.6"
            ghr_app_releases_endpoint: "{{ ghr_app_name }}-{{ ghr_app_version }}"
            ghr_app_archive: "{{ ghr_app_name }}-linux64"
            ghr_app_is_binary: true

    - hosts: localhost
      roles:
        - role: nioniosfr.github_release
          vars:
            ghr_org_name: "digitalocean"
            ghr_app_name: "doctl"
            ghr_app_version: "1.18.0"
            ghr_app_binary_dest: "/usr/local/bin" # Install in a common user directory
            ghr_app_configure_system_path: false # Don’t change the system path
            ghr_app_tmp_dir: "/mnt/nfs_share/downloads" # Change download directory
            ghr_app_cleanup_after: true # Delete the downloaded file and any system setup if it exists from a previous run

License

MIT

Author Information

NioniosFr

Informazioni sul progetto

A generic role to install a binary application released on GitHub in a Linux x86_64 based distro.

Installa
ansible-galaxy install nioniosfr.github_release
Licenza
mit
Download
190
Proprietario
Principal Engineer