显示如下
PLAY [localhost] ***************************************************************
Thursday 01 September 2022 15:35:24 +0800 (0:00:00.032) 0:00:00.032 ****
TASK [Check 2.9.0 <= Ansible version < 2.12.0] *********************************
fatal: [localhost]: FAILED! => {
"assertion": "ansible_version.string is version(maximal_ansible_version, \"<\")",
"changed": false,
"evaluated_to": false,
"msg": "Ansible must be between 2.9.0 and 2.12.0"
}
PLAY RECAP *********************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Playbook run took 0 days, 0 hours, 0 minutes, 0 seconds
Thursday 01 September 2022 15:35:24 +0800 (0:00:00.489) 0:00:00.522 ****
===============================================================================
Check 2.9.0 <= Ansible version < 2.12.0 --------------------------------- 0.49s
KUBOARD SPRAY *****************************************************************
高版本的kuboard-spray容器内有的版本超过了2.9.0 <= Ansible version < 2.12.0这个范围导致报错。
执行以下命令可以查看ansible 的版本
docker exec -it spray容器id /bin/bash
ansible --version
两个办法
①在容器内对ansible 版本进行降级
②选择低版本的Kuboard spray
我使用第二种方法下载Kuboard spray的v1.0.0-alpha.5,运行容器后,查看ansible ,满足要求。再次进行集群安装时,该错误已解决。
root@ubuntu01:~# docker exec -it a855 /bin/bash
root@a8550c3c9180:/kuboard-spray# ansible --version
ansible 2.10.15
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]