summaryrefslogtreecommitdiffstats
path: root/roles/go
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-09-02 22:27:04 +0200
committerAhmed Abdelhalim <[email protected]>2025-09-02 22:27:04 +0200
commitd043c2b3358d39ecc9870e0dd8ed7167faeca1c8 (patch)
tree8e9cdcc258278475cb73ce8fccdcf02cdfa6543f /roles/go
parent8dff233f49f8f55fa16267bd3367007b9346b6a6 (diff)
Fix CI failures and ignore intentionally changing tasks for idem test
Diffstat (limited to 'roles/go')
-rw-r--r--roles/go/tasks/main.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/roles/go/tasks/main.yml b/roles/go/tasks/main.yml
index b9ebbaa8..73f065f3 100644
--- a/roles/go/tasks/main.yml
+++ b/roles/go/tasks/main.yml
@@ -1,4 +1,10 @@
---
+- name: "Ensure bash is installed"
+ become: true
+ ansible.builtin.package:
+ name: "bash"
+ state: "present"
+
- name: "Add Go to shell profile"
ansible.builtin.blockinfile:
path: "{{ ansible_env.HOME }}/.bashrc"
@@ -15,6 +21,8 @@
ansible.builtin.shell: |
set -o pipefail
/home/linuxbrew/.linuxbrew/bin/brew list | grep '^go@' | sed 's/go@//'
+ args:
+ executable: /bin/bash
register: go_installed_versions
changed_when: false
failed_when: false
@@ -39,7 +47,11 @@
- name: "Set latest Go as global version"
ansible.builtin.command:
cmd: "/home/linuxbrew/.linuxbrew/bin/brew link --force go"
+ # The set global version always run and is always changing the system
+ # It's intentional to ignore this task for idempotency test
changed_when: true
+ tags:
+ - molecule-idempotence-notest
- name: "Install and configure Go versions"
when: go_versions | length > 0
@@ -61,4 +73,8 @@
ansible.builtin.command:
cmd: "/home/linuxbrew/.linuxbrew/bin/brew link --overwrite go@{{ go_global_version }}"
when: go_global_version != ""
+ # The set global version always run and is always changing the system
+ # It's intentional to ignore this task for idempotency test
changed_when: true
+ tags:
+ - molecule-idempotence-notest