[FAQ] no test named equalto

[问题澄清]

TiDB集群安装过程中报错:
Ansible FAILED! => playbook: start.yml; TASK: set_fact; message: {“msg”: “The conditional check ‘((existing_api_keys[‘json’] | selectattr(“name”, “equalto”, “grafana_apikey”)) | list) | length == 1’ failed. The error was: no test named ‘equalto’ The error appears to be in ‘/home/tidb/tidb-ansible/common_tasks/create_grafana_api_keys.yml’: line 24, column 3, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: - set_fact: ^ here ”}

[原因分析]

jinja的版本过低

[解决方案]

安装tidb-ansible目录中requirements.txt文件的要求更新版本
sudo pip install --upgrade -r requirements.txt

[参考案例]

请教下,执行 ansible-playbook start.yml 时报错,求解答
请教下,执行 ansible-playbook start.yml 时报错,求解答~

[引申学习点]

了解jinja

https://jinja.palletsprojects.com/en/2.11.x/

1 个赞