sgaunet.gh_role_installer

Ansible Role: gh_role_installer

GitHub release

This Ansible Role is used to install software releases from GitHub. It is meant for installing simple binaries, especially those created with Go or Rust, and is not suited for more complex software.

You can use this role for tools like:

  • bat
  • d2
  • gini
  • goreleaser
  • helm
  • k9s
  • pgweb
  • vhs
  • ...

Requirements

No special requirements.

Role Variables

Here are the variables you can set. The variables gh_role_installer_tmp_directory and gh_role_installer_binary_path have default values:

  • gh_role_installer_version: "latest" # Use "latest" to get the most recent version (it fetches this info from the GitHub API).
  • gh_role_installer_os: "linux" # Specify the operating system to download the release for.
  • gh_role_installer_arch: "amd64" # Define the architecture to download the release.
  • gh_role_installer_repository: "sgaunet/jwt-cli"
  • gh_role_installer_release: "https://github.com/{{ gh_role_installer_repository }}/releases/download/v{{ version_to_install }}/jwt-cli_{{ version_to_install }}{{ gh_role_installer_os }}{{ gh_role_installer_arch }}" # URL for the release download (note that version_to_install will be replaced).
  • gh_role_installer_release_is_archive: false # Set to true if the release is an archive that needs extraction.
  • gh_role_installer_binary_name: "jwt-cli" # The name of the binary to install.
  • gh_role_installer_cmd_to_get_version: "jwt-cli version" # Command to check the version of the installed binary.
  • gh_role_installer_tmp_directory: "{{ lookup('env', 'TMPDIR') | default('/tmp', true) }}" # Temporary directory for downloading the release.
  • gh_role_installer_binary_path: "/usr/local/bin/{{ gh_role_installer_binary_name }}" # Directory for the installed binary.

Dependencies

None.

Example Playbook

- hosts: all
  roles:
    - role: sgaunet.gh_role_installer
      vars:
        gh_role_installer_version: "latest"
        gh_role_installer_os: "unknown-linux-musl"
        gh_role_installer_arch: "x86_64"
        gh_role_installer_repository: "zellij-org/zellij"
        gh_role_installer_release: "https://github.com/{{ gh_role_installer_repository }}/releases/download/v{{ version_to_install }}/zellij-{{ gh_role_installer_arch }}-{{ gh_role_installer_os }}.tar.gz"
        gh_role_installer_release_is_archive: true
        gh_role_installer_binary_name: "zellij"
        gh_role_installer_cmd_to_get_version: 'zellij --version | sed "s#zellij ##g"'
        # gh_role_installer_tmp_directory: "{{ lookup('env', 'TMPDIR') | default('/tmp', true) }}"
        # gh_role_installer_binary_path: "/usr/local/bin/{{ gh_role_installer_binary_name }}"

The role also includes variables for installing various other tools. Check the documentation for the full list of available tools.

License

MIT

Installa
ansible-galaxy install sgaunet.gh_role_installer
Licenza
mit
Download
394
Proprietario