使用pip方式安装ansible的配置文件在哪

我安装ansible的方式用pip安装,但是找不到配置文件,pip方式安装的配置文件在哪的?

/etc目录下是没有的

[root@localhost logs]# cd /etc/an
anacrontab  anthy-conf 

find找了,也没

[root@localhost ~]# find / -name ansible
/usr/local/python27/bin/ansible
/usr/local/python27/lib/python2.7/site-packages/ansible
[root@localhost ~]# cd /usr/local/python27/lib/python2.7/site-packages/ansible
阅读 11.8k
3 个回答

你创建一个/etc/ansible/ansible.cfg

除了 /etc/ansible/ansible.cfg 之外,您還可以在家目錄和專案底下建立 ansible.cfg

  • $HOME/.ansible.cfg

  • $PROJECT_TARGET/ansible.cfg

新手上路,请多包涵

默认情况下就是不存在配置ansible.conf的,你可以去gayhub拉一个配置文件模版。https://raw.githubusercontent...。四种方式,你自己选择

•    ANSIBLE_CONFIG (environment variable if set)
•    ansible.cfg (in the current directory)
•    ~/.ansible.cfg (in the home directory)
•    /etc/ansible/ansible.cfg
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进