Code Monkey home page Code Monkey logo

Comments (4)

apurvaraghu avatar apurvaraghu commented on August 28, 2024

The PyEz connection seems to be working fine in both scenarios with and without the IdentiryFile option.

Below is the playbook used:

---
- name: “Get Device Facts”
  hosts: all
  collections:
    - juniper.device
  connection: juniper.device.pyez
  gather_facts: no

  tasks:
    - name: “Retrieve facts from device running Junos OS”
      juniper.device.facts:
        savedir: "{{ playbook_dir }}"
        config_format: "xml"
      register: result

    - debug:
        var: result

~/.ssh/config file:

Host test
   HostName <ip>
   #IdentityFile ~/.ssh/id_rsa.pub

Playbook Result:

TASK [debug] *************************************************************************************************************************************************************************************************************************************************
task path: /root/ansible_get_unresolved_route/ansible-junos-stdlib/tests/issue626.yml:17
Loading collection ansible.netcommon from /root/.ansible/collections/ansible_collections/ansible/netcommon
<ip> attempting to start connection
<ip> using connection plugin juniper.device.pyez
Found ansible-connection at path /root/ansible_get_unresolved_route/venv/bin/ansible-connection
<1ip> found existing local domain socket, using it!
<ip> Creating device parameters: {'port': 22, 'host': '<ip>', 'user': 'xyz', 'passwd': 'NOT_LOGGING_PARAMETER', 'ssh_private_key_file': None, 'ssh_config': None, 'timeout': 30}
<ip> Opening device.
<ip> Device opened.
<ip> Setting default device timeout to 30.
<ip> created pyez connection type
<ip> Loading collection ansible.builtin from 
<ip> local domain socket path is /root/.ansible/pc/841c49e4b1
ok: [test] => {
    "result": {
        "ansible_facts": {
            "junos": {
                "HOME": "/root",
                "RE0": {
                    "last_reboot_reason": "Router rebooted after a normal shutdown.",
                    "mastership_state": "master",
                    "model": "RE-S-1800x4",
                    "status": "OK",
                    "up_time": "10 days, 16 hours, 42 minutes, 34 seconds"
                },
                "RE1": {
                    "last_reboot_reason": "Router rebooted after a normal shutdown.",
                    "mastership_state": "backup",
                    "model": "RE-S-1800x4",
                    "status": "OK",
                    "up_time": "34 days, 10 hours, 30 minutes, 39 seconds"
                },
                "RE_hw_mi": false,

Host test
   HostName 10.209.8.59
   IdentityFile ~/.ssh/id_rsa.pub


TASK [debug] *************************************************************************************************************************************************************************************************************************************************
task path: /root/ansible_get_unresolved_route/ansible-junos-stdlib/tests/issue626.yml:17
Loading collection ansible.netcommon from /root/.ansible/collections/ansible_collections/ansible/netcommon
<ip> attempting to start connection
<ip> using connection plugin juniper.device.pyez
Found ansible-connection at path /root/ansible_get_unresolved_route/venv/bin/ansible-connection
<ip> found existing local domain socket, using it!
<ip> Creating device parameters: {'port': 22, 'host': '<ip>', 'user': 'xyz', 'passwd': 'NOT_LOGGING_PARAMETER', 'ssh_private_key_file': None, 'ssh_config': None, 'timeout': 30}
<ip> Opening device.
<ip> Device opened.
<ip> Setting default device timeout to 30.
<ip> created pyez connection type
<ip> Loading collection ansible.builtin from 
<ip> local domain socket path is /root/.ansible/pc/7024d9c693
ok: [test] => {
    "result": {
        "ansible_facts": {
            "junos": {
                "HOME": "/root",
                "RE0": {
                    "last_reboot_reason": "Router rebooted after a normal shutdown.",
                    "mastership_state": "master",
                    "model": "RE-S-1800x4",
                    "status": "OK",
                    "up_time": "10 days, 16 hours, 45 minutes, 19 seconds"
                },
                "RE1": {
                    "last_reboot_reason": "Router rebooted after a normal shutdown.",
                    "mastership_state": "backup",
                    "model": "RE-S-1800x4",
                    "status": "OK",
                    "up_time": "34 days, 10 hours, 33 minutes, 20 seconds"
                },
                "RE_hw_mi": false,


Kindly check if the issue is still appearing.

from ansible-junos-stdlib.

chidanandpujar avatar chidanandpujar commented on August 28, 2024

Hi @p3rdu
We are not able to replicate this issue with the given information .
Could you please provide the steps in detail along with commands used for generating the rsa keys , to replicate this issue .

Thank you

from ansible-junos-stdlib.

p3rdu avatar p3rdu commented on August 28, 2024

Hi @p3rdu We are not able to replicate this issue with the given information . Could you please provide the steps in detail along with commands used for generating the rsa keys , to replicate this issue .

Thank you

Unfortunately we've moved on from Junos to SONiC NOS based switches, so I cannot provide any details regarding this case anymore.

from ansible-junos-stdlib.

dineshbaburam91 avatar dineshbaburam91 commented on August 28, 2024

Thank you for reporting the issue. However, we were unable to replicate it and therefore will close the case. @p3rdu

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.