Featured image of post Ansible避免因python提出warning

Ansible避免因python提出warning

前言

报错如下:

[WARNING]: Platform linux on host example.com is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this.

原因

详细可查看:Interpreter Discovery — Ansible Documentation

简单来说就是ansible没找到对应版本的python,因此采用了被控服务器上默认的python而发出warning。

解决方法

编辑ansible配置文件:

1
vim /etc/ansible/ansible.cfg

添加以下配置即可:

1
interpreter_python = auto_legacy_silent
Licensed under CC BY-NC-SA 4.0
最后更新于 May 19, 2022 10:25 CST
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计