From 518d111b03d8ada6368f1c35b9d9e6dc36983afd Mon Sep 17 00:00:00 2001 From: Sven Date: Tue, 17 Sep 2024 09:50:12 +0200 Subject: [PATCH] Add ansible_version (#177) Import from osism/testbed Related: osism/issues#1133 Signed-off-by: Sven Kieske --- roles/ansible_version/README.md | 0 roles/ansible_version/defaults/main.yml | 2 ++ roles/ansible_version/meta/main.yml | 22 ++++++++++++++++++++++ roles/ansible_version/tasks/main.yml | 5 +++++ 4 files changed, 29 insertions(+) create mode 100644 roles/ansible_version/README.md create mode 100644 roles/ansible_version/defaults/main.yml create mode 100644 roles/ansible_version/meta/main.yml create mode 100644 roles/ansible_version/tasks/main.yml diff --git a/roles/ansible_version/README.md b/roles/ansible_version/README.md new file mode 100644 index 0000000..e69de29 diff --git a/roles/ansible_version/defaults/main.yml b/roles/ansible_version/defaults/main.yml new file mode 100644 index 0000000..54aa0c9 --- /dev/null +++ b/roles/ansible_version/defaults/main.yml @@ -0,0 +1,2 @@ +--- +ansible_core_version: "2.16.0" diff --git a/roles/ansible_version/meta/main.yml b/roles/ansible_version/meta/main.yml new file mode 100644 index 0000000..bdc7e54 --- /dev/null +++ b/roles/ansible_version/meta/main.yml @@ -0,0 +1,22 @@ +--- +galaxy_info: + author: Sven Kieske + description: Role osism.validations.kernel_version + company: OSISM GmbH + license: Apache License 2.0 + min_ansible_version: 2.16.0 + platforms: + - name: Ubuntu + versions: + - jammy + - noble + - name: Debian + versions: + - bookworm + - name: EL + versions: + - "9" + galaxy_tags: + - osism + - system +dependencies: [] diff --git a/roles/ansible_version/tasks/main.yml b/roles/ansible_version/tasks/main.yml new file mode 100644 index 0000000..b38dbf6 --- /dev/null +++ b/roles/ansible_version/tasks/main.yml @@ -0,0 +1,5 @@ +--- +- name: "Fail if ansible-core version is lower than {{ ansible_core_version }}" + ansible.builtin.fail: + msg: "Ansible core version is {{ ansible_version.full }}, expected Ansible core version is {{ ansible_core_version }}." + when: ansible_version.full is ansible.builtin.version(ansible_core_version, '<')