summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--roles/ansible/defaults/main.yml1
-rw-r--r--roles/ansible/meta/argument_specs.yml22
-rw-r--r--roles/ansible/tasks/main.yml19
3 files changed, 28 insertions, 14 deletions
diff --git a/roles/ansible/defaults/main.yml b/roles/ansible/defaults/main.yml
index ece03125..a745e81b 100644
--- a/roles/ansible/defaults/main.yml
+++ b/roles/ansible/defaults/main.yml
@@ -1,3 +1,4 @@
---
ansible_core_version: "2.19.3"
molecule_version: "25.9.0"
+ansible_lint_version: "25.9.2"
diff --git a/roles/ansible/meta/argument_specs.yml b/roles/ansible/meta/argument_specs.yml
index fa50e661..6cda5995 100644
--- a/roles/ansible/meta/argument_specs.yml
+++ b/roles/ansible/meta/argument_specs.yml
@@ -4,21 +4,15 @@ argument_specs:
short_description: "Install ansible and molecule on Linux distributions"
description: "Install ansible and molecule on Linux distributions"
options:
- ansible_core_default_version:
+ ansible_core_version:
type: "str"
description: "The default ansible-core version to use (must be in major.minor.patch format)"
- default: "2.18.7"
- ansible_core_versions:
- type: "list"
- elements: "str"
- description: "List of ansible-core versions to install (must be in major.minor.patch format)"
- default: ["2.18.7"]
- molecule_default_version:
+ default: "2.19.3"
+ molecule_version:
type: "str"
description: "The default molecule version to use (must be in major.minor.patch format)"
- default: "25.7.0"
- molecule_versions:
- type: "list"
- elements: "str"
- description: "List of molecule versions to install (must be in major.minor.patch format)"
- default: ["25.7.0"]
+ default: "25.9.0"
+ ansible_lint_version:
+ type: "str"
+ description: "The default ansible-lint version to use (must be in major.minor.patch format)"
+ default: "25.9.2"
diff --git a/roles/ansible/tasks/main.yml b/roles/ansible/tasks/main.yml
index 335dba72..abd4fbb4 100644
--- a/roles/ansible/tasks/main.yml
+++ b/roles/ansible/tasks/main.yml
@@ -43,3 +43,22 @@
executable: /bin/bash
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//'
+ args:
+ executable: /bin/bash
+ register: ansible_lint_installed_version
+ changed_when: false
+ failed_when: false
+
+- name: "Install ansible lint version {{ ansible_lint_version }}"
+ ansible.builtin.shell: |
+ set -euo pipefail
+ uv tool install ansible-lint=={{ ansible_lint_version }} --force
+ args:
+ executable: /bin/bash
+ changed_when: true
+ when: ansible_lint_installed_version.stdout != ansible_lint_version