From d043c2b3358d39ecc9870e0dd8ed7167faeca1c8 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Tue, 2 Sep 2025 22:27:04 +0200 Subject: Fix CI failures and ignore intentionally changing tasks for idem test --- roles/go/tasks/main.yml | 16 ++++++++++++++++ roles/locales/tasks/main.yml | 9 +++++++-- roles/python/tasks/main.yml | 4 ++++ 3 files changed, 27 insertions(+), 2 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 diff --git a/roles/locales/tasks/main.yml b/roles/locales/tasks/main.yml index 8008ec93..cb8175bb 100644 --- a/roles/locales/tasks/main.yml +++ b/roles/locales/tasks/main.yml @@ -2,11 +2,14 @@ - name: "Include OS-specific variables" ansible.builtin.include_vars: "{{ ansible_os_family | lower }}.yml" -- name: "Ensure locales package is installed" +- name: "Ensure locales dependencies are installed" become: true ansible.builtin.package: - name: "{{ locales_pkg }}" + name: "{{ item }}" state: "present" + with_items: + - "{{ locales_pkg }}" + - bash - name: "Read locale.gen file" ansible.builtin.slurp: @@ -24,6 +27,8 @@ ansible.builtin.shell: | set -o pipefail locale -a | grep 'utf8$' | sed 's/.utf8$/.UTF-8 UTF-8/' + args: + executable: /bin/bash register: locales_available changed_when: false diff --git a/roles/python/tasks/main.yml b/roles/python/tasks/main.yml index cb41e1ca..b6eef5cc 100644 --- a/roles/python/tasks/main.yml +++ b/roles/python/tasks/main.yml @@ -63,4 +63,8 @@ - name: "Set global python version" ansible.builtin.command: cmd: "/home/linuxbrew/.linuxbrew/bin/pyenv global {{ python_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 -- cgit v1.2.3