tidb集群离线安装 报错template error while templating string: no filter named ‘‘version_compare’

  • 【TiDB 版本】: ansible 2.9.6 config file = /etc/ansible/ansible.cfg configured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible python version = 2.7.5 (default, Aug 7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

  • 【问题描述】:

[root@TIDB-02 soft]# cd tidb-ansible &&

ansible-playbook local_prepare.yml

PLAY [do local preparation] *******************************************************************************************************************************************************************************************

TASK [local : Stop if ansible version is too low, make sure that the Ansible version is Ansible 2.4.2 or later, otherwise a compatibility issue occurs.] ************************************************************** fatal: [localhost]: FAILED! => msg: ‘The conditional check ‘‘ansible_version.full|version_compare(’‘2.4.2’’, ‘’>=’’)’’ failed. The error was: template error while templating string: no filter named ‘‘version_compare’’. String: {% if ansible_version.full|version_compare(’‘2.4.2’’, ‘’>=’’) %} True {% else %} False {% endif %}’

PLAY RECAP ************************************************************************************************************************************************************************************************************ localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

ERROR MESSAGE SUMMARY ************************************************************************************************************************************************************************************************* [localhost]: Ansible Failed! ==>

msg: ‘The conditional check ‘‘ansible_version.full|version_compare(’‘2.4.2’’, ‘’>=’’)’’ failed. The error was: template error while templating string: no filter named ‘‘version_compare’’. String: {% if ansible_version.full|version_compare(’‘2.4.2’’, ‘’>=’’) %} True {% else %} False {% endif %}’

  1. 您好,请问安装哪个版本的 TiDB
  2. 请检测 ansible --version 是否满足要求,多谢