Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

napalm collection with ansible_network_os fully-qualified #196

Open
slefol opened this issue Jan 28, 2022 · 1 comment
Open

napalm collection with ansible_network_os fully-qualified #196

slefol opened this issue Jan 28, 2022 · 1 comment

Comments

@slefol
Copy link

slefol commented Jan 28, 2022

Since Ansible 2.10, it's recommended to use the fully-qualified collection name (FQCN).

However, when setting ansible_network_os: cisco.ios.ios in the inventory file, a playbook with napalm.napalm.get_facts (for example) returns the following error:
"Failed to import napalm driver: Cannot import "cisco.ios.ios". Is the library installed?"

It's works with ansible_network_os: ios

Example of task :
- name: napalm get_facts
napalm.napalm.get_facts:
filter: facts,interfaces

@ktbyers
Copy link
Collaborator

ktbyers commented Jan 28, 2022

@slefol That one is a bit tough as it really is Ansible breakage and Ansible isn't really using a collection there (it is just a string that they want to convert into a namespaced string--of course they could have chosen better names originally, but they didn't).

And NAPALM is not using anything from Ansible here i.e. we are not using Ansible component to connect (we just want to use the right napalm driver.

So yeah feel free to write a shim and submit a PR that translates cisco.ios.ios back to ios in the NAPALM code (and does similar things for other NAPALM platforms).

In the interim though I would just use the abbreviated name for ansible_network_os.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants