Comments (5)
Do you know if this feature was ever introduced - or do you know a good work-around?
from napalm-ansible.
I think that is done.
Let me know if it doesn't work though.
from napalm-ansible.
Looks like I have the same error:
(ansible) [14:54:16] dvarnum:ansible-neteng git:(master*) $ ansible-playbook napalm_eos_testing.yml -l lab-campus-leaf3 -u dv -k
SSH password:
PLAY [Get facts] *****************************************************************************************************************************************************************
TASK [get facts from device] *****************************************************************************************************************************************************
fatal: [lab-campus-leaf3]: FAILED! => {"changed": false, "msg": "username is required"}
PLAY RECAP ***********************************************************************************************************************************************************************
lab-campus-leaf3 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Here's the playbook:
(ansible) [14:59:14] dvarnum:ansible-neteng git:(master*) $ cat napalm_eos_testing.yml
---
- name: Get facts
hosts: eos
connection: local
gather_facts: no
tasks:
- name: get facts from device
napalm_get_facts:
hostname={{ inventory_hostname }}
dev_os={{ ansible_network_os }}
filter='facts,interfaces,bgp_neighbors'
register: result
- name: print data
debug: var=result
Am I missing something? Thanks for your time!
from napalm-ansible.
Hmmmm, I have to look into the username
passing. I could have swore that worked, but I am seeing the same thing as you when I test it.
The -k
passing works, but the -u username
part is failing.
from napalm-ansible.
This fixes it...not sure why or when this changed though:
$ git diff ./napalm.py
diff --git a/napalm_ansible/plugins/action/napalm.py b/napalm_ansible/plugins/action/napalm.py
index ac37522..bbd70e0 100644
--- a/napalm_ansible/plugins/action/napalm.py
+++ b/napalm_ansible/plugins/action/napalm.py
@@ -13,7 +13,7 @@ class ActionModule(_ActionModule):
provider = self._task.args.get('provider', {})
provider['hostname'] = provider.get('hostname', provider.get('host', pc.remote_addr))
- provider['username'] = provider.get('username', pc.connection_user)
+ provider['username'] = provider.get('username', pc.remote_user)
provider['password'] = provider.get('password', pc.password)
# Timeout can't be passed via command-line as Ansible defaults to a 10 second timeout
provider['timeout'] = provider.get('timeout', 60)
from napalm-ansible.
Related Issues (20)
- Can the action_plugin be made to understand ansible_port properly
- New release HOT 4
- Distribute napalm-ansible as a collection HOT 5
- ios.commit_config() error HOT 3
- conform diff format with ansible format
- napalm-ansible ignoring ProxyCommand HOT 2
- Ansible 2.10 breaks build
- napalm-ping was unreliable when testing it for IOS (does default delay_factor need increased)
- Create a napalm rollback module
- Create a commit + confirm module HOT 11
- Convert the tests over to GitHub Actions
- Review documentation and make sure it is updated properly for using the new napalm collection
- Remove old setup.py and other old non-collection code from this repository
- napalm Collection on AWX 19.0.0 HOT 9
- npalm_install_merge.yml does not revert all changes HOT 1
- napalm collection with ansible_network_os fully-qualified HOT 1
- Netmiko4 read_timeout default is too short for IOS commit_conifg operation HOT 29
- napalm_ping: Add source_interface argument
- napalm module : Error: "'ascii' codec can't encode characters in position 5396-5398: ordinal not in range(128)"} HOT 14
- napalm module : Error: "'ascii' codec can't encode characters in position 5396-5398: ordinal not in range(128)"}
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from napalm-ansible.