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

Baptiste Mille-Mathias
  • 2,144
  • 4
  • 31
  • 37
R.abdhir
  • 75
  • 1
  • 4

2 Answers2

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
techraf
  • 64,883
  • 27
  • 193
  • 198
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
Baptiste Mille-Mathias
  • 2,144
  • 4
  • 31
  • 37