如何在 ansible.cfg 文件中添加多个库路径

我已经使用 pip 安装了 napalm-ansible,现在尝试将 napalm-ansible 库路径添加到我的 ansible.cfg 文件中。


root@usvr-1804:/home/labadmin# napalm-ansible

To ensure Ansible can use the NAPALM modules you will have

to add the following configurtion to your Ansible configuration

file (ansible.cfg):


[defaults]

library = /usr/local/lib/python2.7/dist-packages/napalm_ansible/modules

action_plugins = /usr/local/lib/python2.7/dist 

packages/napalm_ansible/plugins/action

但是我的 ansible.cfg 文件已经有一个库路径。


root@usvr-1804:/home/labadmin# cat ansible.cfg


[defaults]

inventory = ./hosts

library = /etc/ansible/roles/PaloAltoNetworks.paloaltonetworks

host_key_checking = false

timeout = 5

log_path = /var/log/ansible.log

roles_path = /etc/ansible/roles

如何向 ansible.cfg 文件添加第二个库路径。谢谢


白衣染霜花
浏览 234回答 2
2回答

江户川乱折腾

转到Ansible 配置设置的文档 ,找到正确的参数library:library Ansible 将在其中搜索模块的冒号分隔路径。然后相应地配置:library = /etc/ansible/roles/PaloAltoNetworks.paloaltonetworks:/usr/local/lib/python2.7/dist-packages/napalm_ansible/modules
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python