ansible执行出现[Warning]:Platform linux on host * is using the discovered Python interpreter at /usr/bin/python

ansible执行的时候老是出现如下的报警提示,非常不美观,解决方案是:

 

 1、每次执行命令的时候加个参数,跳过这个就不报错了。 -e "ansible_python_interpreter=auto_legacy_silent"

ansible -ihosts_list app  -e "ansible_python_interpreter=auto_legacy_silent" -m ping

 

 2、永久解决方法就是:

解决办法:
 vim /etc/ansible/ansible.cfg
在ansible.cfg的全局配置[defaults]部分添加如下配置
interpreter_python = auto_legacy_silent

 

 


 

 


 

posted @ 2023-02-20 11:56  Cherry_梅  阅读(1706)  评论(0编辑  收藏  举报