darkwizard242.go

Ansible Role: Go

This role installs the Go programming language on Debian/Ubuntu and EL systems.

Requirements

There are no requirements.

Role Variables

The following variables can be found in defaults/main.yml:

Variables list:

go_app: go
go_setup: true
go_version: 1.22.4
go_os: "{{ ansible_system | lower }}"
go_architecture_map:
  amd64: amd64
  arm: arm64
  x86_64: amd64
  armv6l: armv6
  armv7l: armv7
  aarch64: arm64
  32-bit: "386"
  64-bit: amd64
go_dl_url: "https://dl.google.com/{{ go_app }}/{{ go_app }}{{ go_version }}.{{ go_os }}-{{ go_architecture_map[ansible_architecture] }}.tar.gz"
go_bin_path: /usr/local
go_profile_template_export_line: "{{ go_bin_path}}/go/bin"
go_profile_template_path: /etc/profile.d
go_profile_template_source_file: go.j2
go_profile_template_dest_file: go.sh

Variables table:

Variable Description
go_app The application to install, which is go.
go_setup A boolean variable that accepts true or false. Defaults to true. If true, Go will be installed. If false, Go will be removed if it was installed using this role.
go_version The version of Go to install. Defaults to 1.22.4.
go_os The operating system type, used to find the correct binaries.
go_architecture_map Maps different architectures to their binary types.
go_dl_url The URL to download the Go binary.
go_bin_path The path where the Go binary will be stored. Defaults to /usr/local.
go_profile_template_export_line The line for exporting the path to Go’s binary, to be included in a custom file in /etc/profile.d.
go_profile_template_path The directory where the export template for Go’s PATH will be generated.
go_profile_template_source_file The source template file for exporting Go’s binary to PATH.
go_profile_template_dest_file The filename for the exported PATH file that will be placed in /etc/profile.d.

Dependencies

There are no dependencies.

Example Playbook

To install Go with the default settings in your Ansible playbooks:

- hosts: servers
  roles:
    - darkwizard242.go

To specify a different Go version:

- hosts: servers
  roles:
    - darkwizard242.go
  vars:
    go_version: 1.14.0
    go_setup: true

To change the location for the Go binary:

- hosts: servers
  roles:
    - darkwizard242.go
  vars:
    go_bin_path: /bin/

License

MIT

Author Information

This role was created by Ali Muhammad.

Informazioni sul progetto

Installs/Uninstalls 'go' - programming language and sets up system-wide export.

Installa
ansible-galaxy install darkwizard242.go
Licenza
mit
Download
11k
Proprietario
Senior DevOps/CloudOps Engineer. Dedicated to Automating everything I come across. Love to work on and learn new technologies/tools everyday!