Comments (12)
This actually looks like it might be a missing feature from the upstream py-junos-eznc and not necessarily with this module, but I'm not sure as I'm not a Python guy.
from ansible-junos-stdlib.
@tyler-c - correct that ansible_ssh_private_key_file
is not used since the local Junos modules do not get that context. If you ssh-add the file prior to running the Ansible playbook it should work; as this is what I do. I don't know if we can utilize the ansible_ssh_private_key_file
, would require some investigation.
from ansible-junos-stdlib.
@tyler-c - please let me know if loading the ssh-key before running ansible is acceptable at this time. I haven't found a way to use the ansible_ssh_private_key_file
option as of yet. Does not appear that that get's passed natively via module/parameter mechanism.
from ansible-junos-stdlib.
@jeremyschulman Yes, loading the key is fine for now.
from ansible-junos-stdlib.
Hi, I loaded the key via ssh-add and can ssh into the junos device (aliased to "mx_junos") manually just fine, but the junos module is generating this: msg: unable to connect to mx_junos: ConnectAuthError(mx_junos). Any idea what I'm doing wrong? Thanks in advance.
from ansible-junos-stdlib.
@jmorgan415 Share the content of your playbook and host file.
from ansible-junos-stdlib.
Playbook:
-
name: load_config
hosts: mx_junos
roles:- Juniper.junos
connection: local
gather_facts: no
tasks:
- name: Checking NETCONF connectivity
wait_for: host={{ inventory_hostname }} port=830 timeout=5 - name: Create Manual Diversion
junos_install_config:
host={{ inventory_hostname }}
user={{ ansible_ssh_user }}
port=830
file=files/conf_file.conf
overwrite=false
replace=false
timeout=0
diffs_file=logs/commit_check_log
logfile=logs/commit_log
- Juniper.junos
Hosts File (did not include real user):
mx_junos ansible_connection=local ansible_ssh_host=172.16.100.131 ansible_ssh_port=830 ansible_ssh_user=testuser
Note: using Ubuntu 14.04, Ansible 1.9.2, junos-eznc 1.2.2.dev, and junos netconify 1.0.0.
from ansible-junos-stdlib.
If you run the following from the command line, what do you get?
ssh -p 830
from ansible-junos-stdlib.
It's prompting for a password. The only way I can ssh is if I "ssh -i sshkey device". If I add the -p 830, I get this:
PTY allocation request failed on channel 0
shell request failed on channel 0
If I use -p 22, it works. I have netconf setup properly as I have run plenty of other playbooks (using password instead of ssh) on the device, which used port 830.
from ansible-junos-stdlib.
The problem is most likely that when you pushed the public key over to the device, you did so with ssh port 22. You need to do it by scp -P 830 and I think it will work. I am doing this from memory and don;t have a system in front of me, so bear with me.
Since in the playbook you are specifying port 830 and you loaded the public key via port 22 it will never work, it's always wanting the password.
from ansible-junos-stdlib.
Hey i have a same problem. My error fatal: [QFX_17]: FAILED! => {"changed": false, "failed": true, "msg": "unable to connect to XX.XX.XX.XX: ConnectAuthError(XX.XX.XX.XX)"}
My inventory
QFX_17 ansible_connection=local ansible_ssh_host=XX.XX.XX.XX ansible_ssh_port=830 juniper_user=equiptest juniper_passwd=****
my playbook
-
name: test
hosts: QFX_17
connection: localroles:
- Juniper.junos
tasks:
-
name: retrieve facts
junos_facts:
host={{ ansible_ssh_host }}
user={{ ansible_ssh_user }}
passwd={{ juniper_passwd }}
register: info -
name: affichage
debug: msg={{ info.facts }}
And i verified my Netconf connection with ssh equiptest@QFX_17 -p 830 and i get this :
PTY allocation request failed on channel 0
shell request failed on channel 0
Please can you help me to resolv my error . Thank you
from ansible-junos-stdlib.
@mamoudousy Your issue is different. I responded in #220.
from ansible-junos-stdlib.
Related Issues (20)
- Current implementation doesn't handle multi member stacks where versions of members are inconsistent HOT 8
- Ansible SSH connection fails with Authentication Error if I connected to target via host jump HOT 2
- RPC "get-system-core-dumps" with formats "text" only prints the first line of rpc-reply HOT 4
- juniper.device.config module with set system login message " " with "," separated text message replaces "," with newline HOT 2
- Get facts and printing them results in invalid or malformed argument Error HOT 2
- Executing RPC with filters returns The error was: AttributeError: 'JuniperJunosModule' object has no attribute '_check_type_dict' HOT 3
- Address readthedocs upcoming changes HOT 3
- Ansible RPC error with junipe.device.rpc module HOT 2
- ansible-lint violation: missing required arguments: _inventory_hostname, _module_name, _module_utils_path (warning) HOT 2
- juniper.device.software - Software is downloaded for each RE when using remote_package HOT 8
- Feature Request: Add option to not discard uncommitted changes HOT 2
- PyEZ connection fails when ~/.ssh/config has a IdentityFile option for target hosts HOT 4
- sphinx-build -b html . _build/html/ fails with AttributeError: 'Sphinx' object has no attribute 'add_stylesheet' with sphinx 7.2.6 HOT 2
- Random diff on juniper SRX device HOT 1
- Update README to clarify the status of collections vs roles HOT 1
- Update tests to cover all modules, when using pyez connection plugin HOT 1
- All modules fail since Ansible 2.15.9 or >=2.16.3 ("missing required arguments") HOT 9
- Juniper's galaxy module download fails. HOT 1
- juniper.device.config always performs a commit confirmed operation HOT 13
- juniper.device.config does not transmit the error message with juniper.device.pyez connection HOT 2
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 ansible-junos-stdlib.