From 64999de5b93e393518771f86ddc8673cc7dd4e55 Mon Sep 17 00:00:00 2001 From: shaofeng_cheng Date: Fri, 7 Apr 2017 16:04:33 +0800 Subject: [PATCH] Add jinja2-py version check in pre_checks Jinja2-py version is missing in pre_checks. Change-Id: I047722be3d7b4819eade6c675d79a898a2f0024b --- ansible/roles/prechecks/tasks/package_checks.yml | 7 +++++++ ansible/roles/prechecks/vars/main.yml | 1 + 2 files changed, 8 insertions(+) diff --git a/ansible/roles/prechecks/tasks/package_checks.yml b/ansible/roles/prechecks/tasks/package_checks.yml index 4da8264afd..515527a140 100644 --- a/ansible/roles/prechecks/tasks/package_checks.yml +++ b/ansible/roles/prechecks/tasks/package_checks.yml @@ -10,3 +10,10 @@ local_action: fail msg="Current Ansible version {{ ansible_version.full }} is less than {{ ansible_version_min }}" run_once: true when: ansible_version.full | version_compare(ansible_version_min, '<') + +- name: Checking jinja2-py version + command: "{{ ansible_python.executable }} -c \"import jinja2; print jinja2.__version__\"" + register: result + changed_when: false + failed_when: result | failed or + result.stdout | version_compare(jinja2_py_version_min, '<', strict=True) diff --git a/ansible/roles/prechecks/vars/main.yml b/ansible/roles/prechecks/vars/main.yml index fd2237209d..027fc3e516 100644 --- a/ansible/roles/prechecks/vars/main.yml +++ b/ansible/roles/prechecks/vars/main.yml @@ -2,3 +2,4 @@ docker_version_min: '1.10.0' docker_py_version_min: '1.6.0' ansible_version_min: '2.0.0' +jinja2_py_version_min: '2.8.0'