Anaiable执行出现[WARNING]: Platform linux on hostis using the discovered Python interpreter at /usr/bin/python
参考:
https://www.cnblogs.com/itqingtian/p/17136849.html
- 每次执行命令的时候加个参数,跳过这个就不报错了。
-e "ansible_python_interpreter=auto_legacy_silent"
ansible -ihosts_list app -e "ansible_python_interpreter=auto_legacy_silent" -m ping
- 永久解决方案
解决办法:
# vim /etc/ansible/ansible.cfg
ansible.cfg的全局配置[defaults]部分添加如下配置
interpreter_python = auto_legacy_silent