This commit is contained in:
DeveloperDurp 2025-04-06 20:13:27 -05:00
parent 1110cf573c
commit 0e46b7c6be
32 changed files with 799 additions and 0 deletions

View file

@ -0,0 +1,36 @@
- name: Register the current Go version (if any)
command: go version
ignore_errors: yes
register: go_version
changed_when: false
- name: Download the Go tarball
get_url:
url: "https://go.dev/dl/{{ go_tarball }}"
dest: /usr/local/src/{{ go_tarball }}
checksum: "{{ go_checksum }}"
#when: go_version|failed or go_version.stdout != go_version_target
- name: Remove old installation of Go
file:
path: /usr/local/go
state: absent
#when: go_version|failed or go_version.stdout != go_version_target
- name: Extract the Go tarball if Go is not yet installed or not the desired version
unarchive:
src: /usr/local/src/{{ go_tarball }}
dest: /usr/local
copy: no
#when: go_version|failed or go_version.stdout != go_version_target
- name: Add the Go bin directory to the PATH environment variable for all users
copy:
src: go-bin.sh
dest: /etc/profile.d
- name: Set GOPATH for all users
copy:
src: go-path.sh
dest: /etc/profile.d
#when: set_go_path