From 05c50d2cb798a3e7cb201a4fe2acb459ef03c50a Mon Sep 17 00:00:00 2001 From: Erik Skultety Date: Fri, 21 Jul 2023 14:38:40 +0200 Subject: ansible: Bump the minimum Ansible version to 2.10+ It's getting harder to get around with only the builtin modules and we'll need to use some of the curated community modules. The split of Ansible into 'ansible-core' and 'ansible community (aka ansible)' happened in v2.10. The way this patch enforces the version used in by delegating a version check task to localhost, failing if the control node doesn't meet the minimum version. 2.10 is pretty common these days, so essentially only users on Debian-10 would be impacted by this, but then again, installing from PyPI is a simple workaround in that case. Signed-off-by: Erik Skultety --- docs/installation.rst | 8 +++++++- lcitool/ansible/playbooks/update/main.yml | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/installation.rst b/docs/installation.rst index 9d60463..e608ca0 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -56,7 +56,13 @@ single step with: $ pip3 install .["vm_support"] where ``vm_support`` denotes the same set of dependencies as extra dependencies -in a way ``pip`` recognizes for installable packages. +in a way ``pip`` recognizes for installable packages. Additionally, for the +VM use case we require some of the *general* Ansible community modules, so +**Ansible >= 2.10** along with the corresponding Ansible community collections +package (often called simply ``ansible``) is required. This is only relevant if +you install most of your packages from the OS package management software. If +you use the ``pip`` method no action is needed, it'll do the right thing. + Development dependencies ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lcitool/ansible/playbooks/update/main.yml b/lcitool/ansible/playbooks/update/main.yml index a9bfe56..e8587f3 100644 --- a/lcitool/ansible/playbooks/update/main.yml +++ b/lcitool/ansible/playbooks/update/main.yml @@ -1,4 +1,14 @@ --- +- hosts: all + gather_facts: false + tasks: + - name: Ansible version check + assert: + that: ansible_version.full is version('2.10', '>=') + fail_msg: "Please install Ansible >=2.10" + quiet: true + delegate_to: localhost + - import_playbook: user-pre.yml - import_playbook: bootstrap.yml - import_playbook: setup.yml -- cgit v1.1