-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Go installation support using GVM
- Loading branch information
Showing
7 changed files
with
84 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Install GVM (Go Version Manager) | ||
# Source: https://github.com/moovweb/gvm | ||
--- | ||
- name: "[GVM] Install/update GVM" | ||
ansible.builtin.shell: | | ||
set -e -o pipefail | ||
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) | ||
register: gvm_install | ||
args: | ||
creates: "{{ ansible_env.HOME }}/.gvm" | ||
executable: /bin/bash | ||
|
||
- name: "[GVM] Show GVM install/update info" | ||
ansible.builtin.debug: | ||
msg: "{{ gvm_install.stdout | default('No output was passed from GVM install command') }}" | ||
|
||
- name: "[Go] Install Go versions" | ||
ansible.builtin.command: "gvm install {{ goversion }} -B" | ||
args: | ||
creates: "{{ ansible_env.HOME}}/.gvm/environments/{{ goversion }}" | ||
loop: "{{ go_versions }}" | ||
loop_control: | ||
loop_var: goversion | ||
|
||
- name: "[Go] Set default to {{ go_default }}" | ||
ansible.builtin.shell: ". {{ ansible_env.HOME }}/.gvm/scripts/gvm; gvm use {{ go_default }} --default" | ||
args: | ||
executable: /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters