How do I add several library path in ansible.cfg file
Asked Answered
S

2

5

I've installed napalm-ansible using pip, and now trying to add napalm-ansible library path into my ansible.cfg file.

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

But my ansible.cfg file already has a library path.

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

How do I add a second library path to my ansible.cfg file. Thanks

Salgado answered 31/8, 2018 at 17:23 Comment(0)
D
4

Go to the docs for the Ansible Configuration Settings , find the right parameter library:

library Colon separated paths in which Ansible will search for Modules.

then configure accordingly:

library = /etc/ansible/roles/PaloAltoNetworks.paloaltonetworks:/usr/local/lib/python2.7/dist-packages/napalm_ansible/modules
Dempsey answered 31/8, 2018 at 17:29 Comment(1)
Thanks you all for the answerSalgado
S
2

You can put as many paths as you want to the library parameter into the section [defaults], you need just to put a colon between each path (documentation)

[defaults]
...
library = /foo/bar:/foo/baz
Salutary answered 31/8, 2018 at 17:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.