首页 > 解决方案 > 在 Rhel5 服务器上启用 Ansible 执行

问题描述

我正在使用运行 OL 5.x 的 Oracle Exalogic 工程系统开展一个项目,该系统具有 Python 2.4(ansible 想要 2.6 +)。Rhel5 系统默认使用 python-2.4。但是,最新版本的 Ansible 需要 python-2.6 或更高版本(或 python3 3.5 或更高版本)。我部署了一个自定义编译的 python,但它显然缺少很多 python 模块,所以 ansible playbooks 仍然失败。由于它是一个工程系统,oracle 控制它的更新。由于它基于 Oracle Linux 5.x,因此 Python 2.4 是 Oracle 最新提供的。

错误:

[WARNING]: Unhandled error in Python interpreter discovery for host elpr1cn03

致命:[elpr1cn03.mta-bsc.org]:失败!=> {“ansible_facts”:{},“已更改”:false,“failed_modules”:{“setup”:{“ansible_facts”:{“discovered_interpreter_python”:“/usr/bin/python”},“failed”:true ,“module_stderr”:“与 172.25.216.75 的共享连接已关闭。\r\n”,“module_stdout”:“文件\“/home/mtaipat1/.ansible/tmp/ansible-tmp-1606142841.33-4265-222728891794294/AnsiballZ_setup。 py\“, line 72\r\n with open(args_path, 'rb') as f:\r\n ^\r\nSyntaxError: invalid syntax\r\n”, “msg”: “MODULE FAILURE\nSee stdout /stderr for the exact error”, “rc”: 1, “warnings”: [“主机 elpr1cn03.mta-bsc.org 上的平台 linux 正在使用 /usr/bin/python 中发现的 Python 解释器,但未来安装另一个Python 解释器可以改变这一点。请参阅 https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery。

有人对如何解决此问题有任何提示吗?

标签: pythonoracleansible

解决方案


推荐阅读