Code Monkey home page Code Monkey logo

Comments (12)

supertylerc avatar supertylerc commented on July 20, 2024

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.

jeremyschulman avatar jeremyschulman commented on July 20, 2024

@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.

jeremyschulman avatar jeremyschulman commented on July 20, 2024

@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.

supertylerc avatar supertylerc commented on July 20, 2024

@jeremyschulman Yes, loading the key is fine for now.

from ansible-junos-stdlib.

jmorgan415 avatar jmorgan415 commented on July 20, 2024

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.

vnitinv avatar vnitinv commented on July 20, 2024

@jmorgan415 Share the content of your playbook and host file.

from ansible-junos-stdlib.

jmorgan415 avatar jmorgan415 commented on July 20, 2024

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

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.

punisherVX avatar punisherVX commented on July 20, 2024

If you run the following from the command line, what do you get?

ssh -p 830

from ansible-junos-stdlib.

jmorgan415 avatar jmorgan415 commented on July 20, 2024

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.

punisherVX avatar punisherVX commented on July 20, 2024

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.

mamoudousy avatar mamoudousy commented on July 20, 2024

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: local

    roles:

    • 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.

stacywsmith avatar stacywsmith commented on July 20, 2024

@mamoudousy Your issue is different. I responded in #220.

from ansible-junos-stdlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.