Git Product home page Git Product logo

Comments (9)

GGabriele avatar GGabriele commented on August 30, 2024

junos_get_config is not part of ntc-ansible. Anyway, this error is often shown when Ansible can't find the module you're trying to use. Makes sure the module called junos_get_config is available to Ansible.

Closing this.

from ntc-ansible.

haind13 avatar haind13 commented on August 30, 2024

@GGabriele What is platform for devices running Junos OS?
Example: Cisco IOS have cisco_ios (in save_config is cisco_ios_ssh)

from ntc-ansible.

GGabriele avatar GGabriele commented on August 30, 2024

juniper_junos for ntc_show_command, juniper_junos_netconf for others.

from ntc-ansible.

haind13 avatar haind13 commented on August 30, 2024

I execute but error:

[haind4@monitornet61 ansible]$ ansible-playbook ntc_junos_backup.yml --ask-vault-pass
ult password:
รขโ€“ยฝ
PLAY [BACKUP CONFIGS] **********************************************************

TASK [OBTAIN LOGIN CREDENTIALS] ************************************************
ok: [atmtest]

TASK [Save config file to backup] **********************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: jnpr.junos.exception.ConnectTimeoutError: ConnectTimeoutError(10.192.254.201)
fatal: [atmtest]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n File "/tmp/ansible_J3q7so/ansible_module_ntc_save_config.py", line 256, in \n main()\n File "/tmp/ansible_J3q7so/ansible_module_ntc_save_config.py", line 228, in main\n device = ntc_device(device_type, host, username, password, **kwargs)\n File "/usr/lib/python2.7/site-packages/pyntc/init.py", line 35, in ntc_device\n return device_class(*args, **kwargs)\n File "/usr/lib/python2.7/site-packages/pyntc/devices/jnpr_device.py", line 34, in init\n self.open()\n File "/usr/lib/python2.7/site-packages/pyntc/devices/jnpr_device.py", line 46, in open\n self.native.open()\n File "/usr/lib/python2.7/site-packages/jnpr/junos/device.py", line 1200, in open\n raise EzErrors.ConnectTimeoutError(self)\njnpr.junos.exception.ConnectTimeoutError: ConnectTimeoutError(10.192.254.201)\n", "module_stdout": "", "msg": "MODULE FAILURE"}
to retry, use: --limit @/etc/ansible/ntc_junos_backup.retry

PLAY RECAP *********************************************************************
atmtest : ok=1 changed=0 unreachable=0 failed=1

This is my playbook:


  • name: BACKUP CONFIGS
    hosts: junos
    gather_facts: False
    connection: local

    tasks:

    • name: OBTAIN LOGIN CREDENTIALS
      include_vars: secrets_tuantv.yaml

    • name: Save config file to backup
      ntc_save_config:
      platform: juniper_junos_netconf
      host: "{{ ansible_host }}"
      username: "{{ creds['username'] }}"
      password: "{{ creds['password'] }}"
      local_file: /home/haind4/ansible/backup/{{inventory_hostname}}.cfg
      register: results

    • debug: var=results

from ntc-ansible.

GGabriele avatar GGabriele commented on August 30, 2024

ConnectTimeoutError(10.192.254.201) it means your device is not reachable...makes sure it is and that you're using the right credentials.

from ntc-ansible.

haind13 avatar haind13 commented on August 30, 2024

@GGabriele I can ssh by command: ssh [email protected] but execute with playbook error

from ntc-ansible.

GGabriele avatar GGabriele commented on August 30, 2024

Check if NETCONF port is open on the device https://www.juniper.net/techpubs/en_US/junos/topics/reference/configuration-statement/port-edit-system-services-netconf.html

from ntc-ansible.

haind13 avatar haind13 commented on August 30, 2024

I just config SSH (22) ? no config NETCONF port, it's can be default port (830)

from ntc-ansible.

GGabriele avatar GGabriele commented on August 30, 2024

Yeah, I asked to check NETCONF port on Juniper as the module uses NETCONF, not SSH.

Another thing you can do is to test Juniper PyEZ API and see if it works.

Again, due to the error it doesn't seem to be an issue related to ntc-ansible.

from ntc-ansible.

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.