summaryrefslogtreecommitdiffstats
path: root/roles/go/tasks
diff options
context:
space:
mode:
authorAhmed AbdelHalim <[email protected]>2025-09-02 20:01:04 +0200
committerAhmed AbdelHalim <[email protected]>2025-09-02 21:16:01 +0200
commitc4abe4f47d78119a86185b355d2f43dc4ac4dd35 (patch)
tree594047268af50dc908b852f8ae0852ca9737e8a0 /roles/go/tasks
parentf24e3a4409c98e84cae4c0407ed6958cb470ecfb (diff)
Fix homebrew to use commands instead of module to avoid issue with arch
Plus it's cleaner to see what gets installed instead of depending on the module
Diffstat (limited to 'roles/go/tasks')
-rw-r--r--roles/go/tasks/main.yml20
1 files changed, 8 insertions, 12 deletions
diff --git a/roles/go/tasks/main.yml b/roles/go/tasks/main.yml
index 52854f8f..a7fd08d4 100644
--- a/roles/go/tasks/main.yml
+++ b/roles/go/tasks/main.yml
@@ -15,30 +15,26 @@
when: go_versions | length == 0
block:
- name: "Install latest Go"
- community.general.homebrew:
- name: "go"
- state: "present"
+ ansible.builtin.command:
+ cmd: "/home/linuxbrew/.linuxbrew/bin/brew install go"
+ creates: "/home/linuxbrew/.linuxbrew/bin/go"
- name: "Set latest Go as global version"
ansible.builtin.command:
- cmd: "brew link --force go"
- environment:
- PATH: "/home/linuxbrew/.linuxbrew/bin:{{ ansible_env.PATH }}"
+ cmd: "/home/linuxbrew/.linuxbrew/bin/brew link --force go"
changed_when: true
- name: "Install and configure Go versions"
when: go_versions | length > 0
block:
- name: "Install specific Go versions"
- community.general.homebrew:
- name: "go@{{ item }}"
- state: "present"
+ ansible.builtin.command:
+ cmd: "/home/linuxbrew/.linuxbrew/bin/brew install go@{{ item }}"
+ creates: "/home/linuxbrew/.linuxbrew/Cellar/go@{{ item }}"
with_items: "{{ go_versions }}"
- name: "Set specific Go version as global"
ansible.builtin.command:
- cmd: "brew link --force go@{{ go_global_version }}"
- environment:
- PATH: "/home/linuxbrew/.linuxbrew/bin:{{ ansible_env.PATH }}"
+ cmd: "/home/linuxbrew/.linuxbrew/bin/brew link --force go@{{ go_global_version }}"
when: go_global_version != ""
changed_when: true