diff options
| author | Ahmed Abdelhalim <[email protected]> | 2026-03-04 00:57:15 +0100 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2026-03-04 00:57:15 +0100 |
| commit | f1cbe79f7573a383ff084cd99e00a36e457fdaef (patch) | |
| tree | a614cef29c6e837e9c21d2928c57fc8be8e59d2e | |
| parent | 570555cf2d464078190240df724ca4f148c72b48 (diff) | |
Refactor ansible/yamllint roles to use mise
| -rw-r--r-- | group_vars/all.yml | bin | 4454 -> 4326 bytes | |||
| -rw-r--r-- | host_vars/archlinux.local.yml | bin | 1245 -> 1361 bytes | |||
| -rw-r--r-- | host_vars/archlinux.local.yml.example | 7 | ||||
| -rw-r--r-- | host_vars/mac.local.yml | bin | 1073 -> 1189 bytes | |||
| -rw-r--r-- | host_vars/mac.local.yml.example | 6 | ||||
| -rw-r--r-- | roles/ansible/meta/main.yml | 2 | ||||
| -rw-r--r-- | roles/ansible/tasks/main.yml | 28 | ||||
| -rw-r--r-- | roles/yamllint/meta/main.yml | 1 | ||||
| -rw-r--r-- | roles/yamllint/tasks/main.yml | 11 |
9 files changed, 34 insertions, 21 deletions
diff --git a/group_vars/all.yml b/group_vars/all.yml Binary files differindex 55b74c37..cba875ac 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml diff --git a/host_vars/archlinux.local.yml b/host_vars/archlinux.local.yml Binary files differindex f4d0568e..73aba2f6 100644 --- a/host_vars/archlinux.local.yml +++ b/host_vars/archlinux.local.yml diff --git a/host_vars/archlinux.local.yml.example b/host_vars/archlinux.local.yml.example index e8bad3f4..87de2580 100644 --- a/host_vars/archlinux.local.yml.example +++ b/host_vars/archlinux.local.yml.example @@ -19,9 +19,10 @@ nodejs_versions: python_versions: - "3.13.7" - "3.12.11" - -ansible_core_version: "2.18.7" -molecule_version: "25.7.0" +ansible_core_version: "2.20.1" +molecule_version: "25.9.0" +ansible_lint_version: "25.9.2" +yamllint_version: "1.37.1" wireguard_connections: wg-vpn1: | diff --git a/host_vars/mac.local.yml b/host_vars/mac.local.yml Binary files differindex bfb759f7..78e5711c 100644 --- a/host_vars/mac.local.yml +++ b/host_vars/mac.local.yml diff --git a/host_vars/mac.local.yml.example b/host_vars/mac.local.yml.example index c301010c..99936ff4 100644 --- a/host_vars/mac.local.yml.example +++ b/host_vars/mac.local.yml.example @@ -19,8 +19,10 @@ nodejs_versions: python_versions: - "3.13.7" - "3.12.11" -ansible_core_version: "2.18.7" -molecule_version: "25.7.0" +ansible_core_version: "2.20.1" +molecule_version: "25.9.0" +ansible_lint_version: "25.9.2" +yamllint_version: "1.37.1" wireguard_connections: wg-vpn1: | diff --git a/roles/ansible/meta/main.yml b/roles/ansible/meta/main.yml index 3611082e..d8f2ab7f 100644 --- a/roles/ansible/meta/main.yml +++ b/roles/ansible/meta/main.yml @@ -1,5 +1,7 @@ --- dependencies: + - role: "bash" + - role: "mise" - role: "python" - role: "sshpass" - role: "yamllint" diff --git a/roles/ansible/tasks/main.yml b/roles/ansible/tasks/main.yml index b5ac2066..e5477416 100644 --- a/roles/ansible/tasks/main.yml +++ b/roles/ansible/tasks/main.yml @@ -9,47 +9,57 @@ - name: "Check ansible-core version {{ ansible_core_version }}" ansible.builtin.shell: | set -euo pipefail - uv tool list | grep "^ansible-core " | awk '{print $2}' | sed 's/^v//' + mise exec uv -- tool list | grep "^ansible-core " | awk '{print $2}' | sed 's/^v//' args: executable: /bin/bash register: ansible_core_installed_version changed_when: false failed_when: false -- name: "Install ansible core version {{ ansible_core_version }}" +- name: "Install ansible-core {{ ansible_core_version }}" ansible.builtin.command: - cmd: "uv tool install ansible-core=={{ ansible_core_version }} --force" + cmd: "mise exec uv -- tool install ansible-core=={{ ansible_core_version }} --force" changed_when: true when: ansible_core_installed_version.stdout != ansible_core_version - name: "Check molecule version {{ molecule_version }}" ansible.builtin.shell: | set -euo pipefail - uv tool list | grep "^molecule " | awk '{print $2}' | sed 's/^v//' + mise exec uv -- tool list | grep "^molecule " | awk '{print $2}' | sed 's/^v//' args: executable: /bin/bash register: molecule_installed_version changed_when: false failed_when: false -- name: "Install molecule version {{ molecule_version }}" +- name: "Install molecule {{ molecule_version }}" ansible.builtin.command: - cmd: "uv tool install molecule=={{ molecule_version }} --with 'molecule-plugins[docker,podman]' --force" + argv: + - "mise" + - "exec" + - "uv" + - "--" + - "tool" + - "install" + - "molecule=={{ molecule_version }}" + - "--with" + - "molecule-plugins[docker,podman]" + - "--force" changed_when: true when: molecule_installed_version.stdout != molecule_version - name: "Check ansible-lint version {{ ansible_lint_version }}" ansible.builtin.shell: | set -euo pipefail - uv tool list | grep "^ansible-lint " | awk '{print $2}' | sed 's/^v//' + mise exec uv -- tool list | grep "^ansible-lint " | awk '{print $2}' | sed 's/^v//' args: executable: /bin/bash register: ansible_lint_installed_version changed_when: false failed_when: false -- name: "Install ansible lint version {{ ansible_lint_version }}" +- name: "Install ansible-lint {{ ansible_lint_version }}" ansible.builtin.command: - cmd: "uv tool install ansible-lint=={{ ansible_lint_version }} --force" + cmd: "mise exec uv -- tool install ansible-lint=={{ ansible_lint_version }} --force" changed_when: true when: ansible_lint_installed_version.stdout != ansible_lint_version diff --git a/roles/yamllint/meta/main.yml b/roles/yamllint/meta/main.yml index 2cf216b5..4daf5d20 100644 --- a/roles/yamllint/meta/main.yml +++ b/roles/yamllint/meta/main.yml @@ -1,6 +1,7 @@ --- dependencies: - role: "bash" + - role: "mise" - role: "python" galaxy_info: author: "a14m" diff --git a/roles/yamllint/tasks/main.yml b/roles/yamllint/tasks/main.yml index 4ca2d2ba..609feed5 100644 --- a/roles/yamllint/tasks/main.yml +++ b/roles/yamllint/tasks/main.yml @@ -2,18 +2,15 @@ - name: "Check yamllint version {{ yamllint_version }}" ansible.builtin.shell: | set -euo pipefail - uv tool list | grep "^yamllint " | awk '{print $2}' | sed 's/^v//' + mise exec uv -- tool list | grep "^yamllint " | awk '{print $2}' | sed 's/^v//' args: executable: /bin/bash register: yamllint_installed_version changed_when: false failed_when: false -- name: "Install yamllint version {{ yamllint_version }}" - ansible.builtin.shell: | - set -euo pipefail - uv tool install yamllint=={{ yamllint_version }} --force - args: - executable: /bin/bash +- name: "Install yamllint {{ yamllint_version }}" + ansible.builtin.command: + cmd: "mise exec uv -- tool install yamllint=={{ yamllint_version }} --force" changed_when: true when: yamllint_installed_version.stdout != yamllint_version |
