由于在导入Ansible做自动化管理时,服务器版本太老,导致Python也相应比较旧,新版本的Ansible无法调用相关模块来管控。
Ansible2.3是最后一个版本支持Python2.4和Python2.5的,以下是官方内容:
链接:https://docs.ansible.com/ansible/devel/dev_guide/developing_python_3.html#minimum-version-of-python-3-x-and-python-2-x
Python 2.4 Module-side Support:
Support for Python 2.4 and Python 2.5 was dropped in Ansible-2.4. RHEL-5 (and its rebuilds like CentOS-5) were supported until April of 2017. Ansible-2.3 was released in April of 2017 and was the last Ansible release to support Python 2.4 on the module-side.
对于如何使用ansible管理RHEL5.X等这些Python2.4的系统,有以下几种方法:
1.升级服务器端的python版本---个人不推荐,如需详细可以百度,当然,成功升级后就不局限于Ansible2.3这个版本了,可以使用较高版本。
2.在每台被管理的服务器上安装python-simplejson,参考资料如下:
链接:https://docs.ansible.com/ansible/2.3/intro_installation.html
On the managed nodes, you need