From 23daec748c2f73b19987ef29075ec17b03cadd07 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Fri, 2 Oct 2020 11:52:17 +0300 Subject: [PATCH] Require Ansible v2.7 or newer (because of items2dict and dict2items) Interestingly, no one has reported this failure before #662 (Github Issue). It doesn't make sense to keep saying that we support such old Ansible versions, when we're not even testing on anything close to those. Time is also passing and such versions are getting more and more ancient. It's time we bumped our requirements to something that is more likely to work. --- docs/ansible.md | 4 ++-- roles/matrix-base/tasks/sanity_check.yml | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/ansible.md b/docs/ansible.md index 1ba430f4..1ac08b5f 100644 --- a/docs/ansible.md +++ b/docs/ansible.md @@ -9,7 +9,7 @@ If your local computer cannot run Ansible, you can also run Ansible on some serv ## Supported Ansible versions -Ansible 2.5.2 or newer is required. +Ansible 2.7.0 or newer is required. ## Checking your Ansible version @@ -49,7 +49,7 @@ docker run -it --rm \ -v `pwd`:/work \ -v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa:ro \ --entrypoint=/bin/sh \ -devture/ansible:2.9.9-r0 +devture/ansible:2.9.13-r0 ``` The above command tries to mount an SSH key (`$HOME/.ssh/id_rsa`) into the container (at `/root/.ssh/id_rsa`). diff --git a/roles/matrix-base/tasks/sanity_check.yml b/roles/matrix-base/tasks/sanity_check.yml index 23f90b85..e504bfe9 100644 --- a/roles/matrix-base/tasks/sanity_check.yml +++ b/roles/matrix-base/tasks/sanity_check.yml @@ -1,13 +1,10 @@ --- -# We generally support Ansible 2.5.2 and above. -# -# Ansible 2.5.0 and 2.5.1 are known to have a bug with `include_tasks` + `with_items`. -# The bug has been fixed in Ansible 2.5.2. -- name: Fail if running on Ansible < 2.5 or Ansible 2.5.x (lower than 2.5.2) +# We generally support Ansible 2.7.0 and above. +- name: Fail if running on Ansible < 2.7 fail: msg: "You are running on Ansible {{ ansible_version.string }}, which is not supported. See our guide about Ansible: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/ansible.md" - when: "(ansible_version.major < 2) or (ansible_version.major <= 2 and ansible_version.minor < 5) or (ansible_version.major == 2 and ansible_version.minor == 5 and ansible_version.revision < 2)" + when: "(ansible_version.major < 2) or (ansible_version.major <= 2 and ansible_version.minor < 7)" - name: (Deprecation) Catch and report renamed settings fail: