installationansibleversiontidb

TiDB-ansible installation - ansible-playbook local_prepare.yml command failure


I am trying to install tidb on a single node using tidb ansible. I have set up the right IP address for PD, TiDB and TiKV server in inventory.ini file. I am following the instructions in https://pingcap.com/docs/v1.0/op-guide/ansible-deployment/. However I am facing the following error with command: ansible-playbook local_prepare.yml. The ansible complains about an older version inspite of being on latest ansible version. It would be really great if someone could help me in installation of TiDB

    [root@fm42cephnode005 tidb-ansible-master]# ansible --version
    ansible 2.9.1
      config file = /home/tidb-ansible-master/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@fm42cephnode005 tidb-ansible-master]# 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 111

    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 %}'

Solution