离线TiDB Ansible , 执行 `local_prepare.yml` playbook,联网下载 TiDB binary 到下载机 出错

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:3.0.8
  • 【问题描述】:离线TiDB Ansible , 执行 local_prepare.yml playbook,联网下载 TiDB binary 到下载机 出错

[tidb@zmx000 ~]$ ansible --version ansible 2.9.1 config file = /etc/ansible/ansible.cfg configured module search path = [u’/home/tidb/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /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)] [tidb@zmx000 ~]$ git clone -b v3.0.8 https://github.com/pingcap/tidb-ansible.git Cloning into ‘tidb-ansible’… remote: Enumerating objects: 23, done. remote: Counting objects: 100% (23/23), done. remote: Compressing objects: 100% (18/18), done. remote: Total 11121 (delta 7), reused 10 (delta 4), pack-reused 11098 Receiving objects: 100% (11121/11121), 3.27 MiB | 79.00 KiB/s, done. Resolving deltas: 100% (6860/6860), done. Note: checking out ‘0e9db4859b3f262aaee22427f2611625425b5a11’.

You are in ‘detached HEAD’ state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:

git checkout -b new_branch_name

[tidb@zmx000 ~]$ 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 %}”} Traceback (most recent call last): File “/usr/lib64/python2.7/logging/init.py”, line 851, in emit msg = self.format(record) File “/usr/lib64/python2.7/logging/init.py”, line 724, in format return fmt.format(record) File “/usr/lib64/python2.7/logging/init.py”, line 467, in format s = self._fmt % record.dict KeyError: ‘user’ Logged from file help.py, line 48

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

ERROR MESSAGE SUMMARY ************************************************************************************************************** [localhost]: Ansible FAILED! => playbook: local_prepare.yml; 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.; message: {“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 %}”} Ask for help: Contact us: support@pingcap.com [WARNING]: Failure using method (v2_playbook_on_stats) in callback plugin (<ansible.plugins.callback.help.CallbackModule object at 0x7f2d37211690>): Invalid color supplied to display: white [tidb@zmx000 tidb-ansible]$

可以看下这个链接:

以及官网对 ansible 版本的要求: