Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netconf_get fails with '''known_hosts_lookup' is not defined" although the host is present in known_hosts #377

Open
jean-christophe-manciot opened this issue Mar 4, 2022 · 0 comments
Assignees

Comments

@jean-christophe-manciot
Copy link

jean-christophe-manciot commented Mar 4, 2022

SUMMARY

netconf_get complains about the host not being defined in the user's .ssh/known_hosts file, although:

  • the error message appears also when SSH is not used
  • the host is defined in that file:
$ ssh-keygen -H -F 172.21.126.182
# Host 172.21.126.182 found: line 1 
|1... ssh-rsa ...
  • there is no such issue with network_cli with or without using SSH (as shown below)
  • a workaround is to launch the playbookj with "ANSIBLE_HOST_KEY_CHECKING=false"
ISSUE TYPE
  • Bug Report
COMPONENT NAME

netconf_get

ANSIBLE VERSION
ansible [core 2.12.3]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/dist-packages/ansible
  ansible collection location = /opt
  executable location = /usr/local/bin/ansible
  python version = 3.9.10 (main, Feb 22 2022, 13:54:07) [GCC 11.2.0]
  jinja version = 3.0.3
  libyaml = True
COLLECTION VERSION
ansible-galaxy collection list --server release_galaxy ansible.netcommon

# /usr/local/lib/python3.9/dist-packages/ansible_collections
Collection        Version
----------------- -------
ansible.netcommon 2.5.1  
CONFIGURATION
$ ansible-config dump --only-changed
CACHE_PLUGIN(/etc/ansible/ansible.cfg) = redis
CACHE_PLUGIN_CONNECTION(/etc/ansible/ansible.cfg) = localhost:<port>:0:<password>
CACHE_PLUGIN_TIMEOUT(/etc/ansible/ansible.cfg) = 259200
COLLECTIONS_PATHS(/etc/ansible/ansible.cfg) = ['/opt']
DEFAULT_EXECUTABLE(/etc/ansible/ansible.cfg) = /bin/bash
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 1000
DEFAULT_GATHERING(/etc/ansible/ansible.cfg) = explicit
DEFAULT_GATHER_TIMEOUT(/etc/ansible/ansible.cfg) = 30
DEFAULT_HASH_BEHAVIOUR(/etc/ansible/ansible.cfg) = replace
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/etc/ansible/hosts']
DEFAULT_LOAD_CALLBACK_PLUGINS(/etc/ansible/ansible.cfg) = True
DEFAULT_LOG_PATH(/etc/ansible/ansible.cfg) = /var/log/ansible.log
DEFAULT_PRIVATE_ROLE_VARS(/etc/ansible/ansible.cfg) = False
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = yaml
DEFAULT_TIMEOUT(/etc/ansible/ansible.cfg) = 180
DEFAULT_TRANSPORT(/etc/ansible/ansible.cfg) = ssh
ENABLE_TASK_DEBUGGER(/etc/ansible/ansible.cfg) = True
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = True
INJECT_FACTS_AS_VARS(/etc/ansible/ansible.cfg) = True
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = /usr/bin/python3
PERSISTENT_COMMAND_TIMEOUT(/etc/ansible/ansible.cfg) = 3599
PERSISTENT_CONNECT_RETRY_TIMEOUT(/etc/ansible/ansible.cfg) = 200
PERSISTENT_CONNECT_TIMEOUT(/etc/ansible/ansible.cfg) = 3600
RETRY_FILES_ENABLED(/etc/ansible/ansible.cfg) = False
SHOW_CUSTOM_STATS(/etc/ansible/ansible.cfg) = True
OS / ENVIRONMENT

Ubuntu 21.10 impish

STEPS TO REPRODUCE

This issue is the same with <ansible_network_cli_ssh_type> as:

  • libssh
  • paramiko
- name: Testing network_cli connection with SSH
  hosts:
        - all
  strategy: debug
  tasks:
        - set_fact:
                ansible_connection: ansible.netcommon.network_cli
                ansible_network_os: ios
                ansible_network_cli_ssh_type: libssh
                ansible_ssh_private_key_file: "/home/admin/.ssh/id_rsa_4096"
                ansible_ssh_private_key_file_password: "password"
                ansible_user: "admin"

        - name: Getting all facts
          ios_facts:
                gather_subset: all
          
- name: Testing network_cli connection without SSH
  hosts:
        - all
  strategy: debug
  tasks:
        - set_fact:
                ansible_connection: ansible.netcommon.network_cli
                ansible_network_os: ios
                ansible_ssh_private_key_file:
                ansible_ssh_private_key_file_password:
                ansible_user: "admin"
                ansible_password: "passord"

        - name: Getting all facts
          ios_facts:
                gather_subset: all
          
- name: Testing netconf connection with SSH
  hosts:
        - all
  strategy: debug
  tasks:
        - set_fact:
                ansible_connection: ansible.netcommon.netconf
                ansible_network_os: default
                ansible_network_cli_ssh_type: libssh
                ansible_private_key_file: "/home/admin/.ssh/id_rsa_4096"
                ansible_user: "admin"

        - name: Getting running configuration and state data
          netconf_get:
  ignore_errors: yes
        
- name: Testing netconf connection without SSH
  hosts:
        - all
  strategy: debug
  tasks:
        - set_fact:
                ansible_connection: ansible.netcommon.netconf
                ansible_network_os: default
                ansible_private_key_file:
                ansible_user: "admin"
                ansible_password: "password"
                        
        - name: Getting running configuration and state data
          netconf_get:
  ignore_errors: yes
EXPECTED RESULTS

Being able to connect to the network device over netconf.

ACTUAL RESULTS
  • This playbook is run over a Cisco CSR 1kv 17.3.1a.
  • This playbook is run as root for the 'admin' user on the network device, but the issue happens also when it is run as 'admin'.
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing hosts as it did not pass its verify_file() method
script declined parsing hosts as it did not pass its verify_file() method
auto declined parsing hosts as it did not pass its verify_file() method
Parsed hosts inventory source with ini plugin
redirecting (type: cache) ansible.builtin.redis to community.general.redis
Loading collection community.general from /usr/local/lib/python3.9/dist-packages/ansible_collections/community/general
Redis connection: Redis<ConnectionPool<Connection<host=localhost,port=6379,db=0>>>
redirecting (type: modules) ansible.builtin.ios_facts to cisco.ios.ios_facts
Loading collection cisco.ios from /usr/local/lib/python3.9/dist-packages/ansible_collections/cisco/ios
redirecting (type: modules) ansible.builtin.ios_facts to cisco.ios.ios_facts
redirecting (type: modules) ansible.builtin.netconf_get to ansible.netcommon.netconf_get
Loading collection ansible.netcommon from /usr/local/lib/python3.9/dist-packages/ansible_collections/ansible/netcommon
redirecting (type: modules) ansible.builtin.netconf_get to ansible.netcommon.netconf_get
redirecting (type: callback) ansible.builtin.yaml to community.general.yaml
redirecting (type: callback) ansible.builtin.yaml to community.general.yaml
Loading callback plugin community.general.yaml of type stdout, v2.0 from /usr/local/lib/python3.9/dist-packages/ansible_collections/community/general/plugins/callback/yaml.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
 ________________________________________
< PLAYBOOK: netconf connection issue.yml >
 ----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Positional arguments: issues/netconf connection issue.yml
verbosity: 4
connection: ssh
timeout: 180
become_method: sudo
tags: ('all',)
inventory: ('hosts',)
subset: CSR1000v-17.3.1a
forks: 1000
4 plays in issues/netconf connection issue.yml
  ________________________________________________
< PLAY [Testing network_cli connection with SSH] >
 ------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

META: ran handlers
 _________________
< TASK [set_fact] >
 -----------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

task path: playbooks/issues/netconf connection issue.yml:14
redirecting (type: become) ansible.builtin.enable to ansible.netcommon.enable
ok: [CSR1000v-17.3.1a] => changed=false 
  ansible_facts:
    ansible_connection: ansible.netcommon.network_cli
    ansible_network_os: ios
    ansible_ssh_private_key_file: /home/admin/.ssh/id_rsa_4096
    ansible_ssh_private_key_file_password: ''
    ansible_user: admin
 __________________________
< TASK [Getting all facts] >
 --------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

task path: playbooks/issues/netconf connection issue.yml:21
redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
redirecting (type: become) ansible.builtin.enable to ansible.netcommon.enable
<172.21.126.182> attempting to start connection
<172.21.126.182> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /usr/local/bin/ansible-connection
<172.21.126.182> local domain socket does not exist, starting it
<172.21.126.182> control socket path is /root/.ansible/pc/61adb371cc
<172.21.126.182> Loading collection ansible.netcommon from /usr/local/lib/python3.9/dist-packages/ansible_collections/ansible/netcommon
<172.21.126.182> redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
<172.21.126.182> Loading collection cisco.ios from /usr/local/lib/python3.9/dist-packages/ansible_collections/cisco/ios
<172.21.126.182> redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
<172.21.126.182> local domain socket listeners started successfully
<172.21.126.182> loaded cliconf plugin ansible_collections.cisco.ios.plugins.cliconf.ios from path /usr/local/lib/python3.9/dist-packages/ansible_collections/cisco/ios/plugins/cliconf/ios.py for network_os ios
<172.21.126.182> ssh type is set to libssh
<172.21.126.182> 
<172.21.126.182> local domain socket path is /root/.ansible/pc/61adb371cc
redirecting (type: action) ansible.builtin.ios to cisco.ios.ios
<172.21.126.182> Using network group action ios for ios_facts
redirecting (type: action) ansible.builtin.ios to cisco.ios.ios
<172.21.126.182> ANSIBLE_NETWORK_IMPORT_MODULES: disabled
<172.21.126.182> ANSIBLE_NETWORK_IMPORT_MODULES: module execution time may be extended
<172.21.126.182> ESTABLISH LOCAL CONNECTION FOR USER: root
<172.21.126.182> EXEC /bin/bash -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-local-2626466p6ejwzuc `"&& mkdir "` echo /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403480.9004638-2626587-163804988606688 `" && echo ansible-tmp-1646403480.9004638-2626587-163804988606688="` echo /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403480.9004638-2626587-163804988606688 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.ios_facts to cisco.ios.ios_facts
Using module file /usr/local/lib/python3.9/dist-packages/ansible_collections/cisco/ios/plugins/modules/ios_facts.py
<172.21.126.182> PUT /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/tmp1wa0f08i TO /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403480.9004638-2626587-163804988606688/AnsiballZ_ios_facts.py
<172.21.126.182> EXEC /bin/bash -c 'chmod u+x /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403480.9004638-2626587-163804988606688/ /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403480.9004638-2626587-163804988606688/AnsiballZ_ios_facts.py && sleep 0'
<172.21.126.182> EXEC /bin/bash -c '/usr/bin/python3 /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403480.9004638-2626587-163804988606688/AnsiballZ_ios_facts.py && sleep 0'
<172.21.126.182> EXEC /bin/bash -c 'rm -f -r /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403480.9004638-2626587-163804988606688/ > /dev/null 2>&1 && sleep 0'
ok: [CSR1000v-17.3.1a] => changed=false 
  ansible_facts:
    ansible_net_all_ipv4_addresses:
    - 172.21.126.182
...
    ansible_net_system: ios
    ansible_net_version: 17.03.01a
    ansible_network_resources: {}
  invocation:
    module_args:
      available_network_resources: false
      gather_network_resources: null
      gather_subset:
      - all
      provider: null
META: ran handlers
META: ran handlers
 ___________________________________________________
< PLAY [Testing network_cli connection without SSH] >
 ---------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

META: ran handlers
 _________________
< TASK [set_fact] >
 -----------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

task path: playbooks/issues/netconf connection issue.yml:30
redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
redirecting (type: become) ansible.builtin.enable to ansible.netcommon.enable
<172.21.126.182> attempting to start connection
<172.21.126.182> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /usr/local/bin/ansible-connection
<172.21.126.182> local domain socket does not exist, starting it
<172.21.126.182> control socket path is /root/.ansible/pc/61adb371cc
<172.21.126.182> Loading collection ansible.netcommon from /usr/local/lib/python3.9/dist-packages/ansible_collections/ansible/netcommon
<172.21.126.182> redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
<172.21.126.182> Loading collection cisco.ios from /usr/local/lib/python3.9/dist-packages/ansible_collections/cisco/ios
<172.21.126.182> redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
<172.21.126.182> local domain socket listeners started successfully
<172.21.126.182> loaded cliconf plugin ansible_collections.cisco.ios.plugins.cliconf.ios from path /usr/local/lib/python3.9/dist-packages/ansible_collections/cisco/ios/plugins/cliconf/ios.py for network_os ios
<172.21.126.182> ssh type is set to libssh
<172.21.126.182> 
<172.21.126.182> local domain socket path is /root/.ansible/pc/61adb371cc
ok: [CSR1000v-17.3.1a] => changed=false 
  ansible_facts:
    ansible_connection: ansible.netcommon.network_cli
    ansible_network_os: ios
    ansible_password: password
    ansible_ssh_private_key_file: null
    ansible_ssh_private_key_file_password: null
    ansible_user: admin
 __________________________
< TASK [Getting all facts] >
 --------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

task path: playbooks/issues/netconf connection issue.yml:38
redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
redirecting (type: become) ansible.builtin.enable to ansible.netcommon.enable
<172.21.126.182> attempting to start connection
<172.21.126.182> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /usr/local/bin/ansible-connection
<172.21.126.182> found existing local domain socket, using it!
<172.21.126.182> updating play_context for connection
<172.21.126.182> 
<172.21.126.182> local domain socket path is /root/.ansible/pc/61adb371cc
redirecting (type: action) ansible.builtin.ios to cisco.ios.ios
<172.21.126.182> Using network group action ios for ios_facts
redirecting (type: action) ansible.builtin.ios to cisco.ios.ios
<172.21.126.182> ANSIBLE_NETWORK_IMPORT_MODULES: disabled
<172.21.126.182> ANSIBLE_NETWORK_IMPORT_MODULES: module execution time may be extended
<172.21.126.182> ESTABLISH LOCAL CONNECTION FOR USER: root
<172.21.126.182> EXEC /bin/bash -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-local-2626466p6ejwzuc `"&& mkdir "` echo /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403485.2815678-2627077-159454561238274 `" && echo ansible-tmp-1646403485.2815678-2627077-159454561238274="` echo /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403485.2815678-2627077-159454561238274 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.ios_facts to cisco.ios.ios_facts
Using module file /usr/local/lib/python3.9/dist-packages/ansible_collections/cisco/ios/plugins/modules/ios_facts.py
<172.21.126.182> PUT /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/tmpcp8ulgsv TO /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403485.2815678-2627077-159454561238274/AnsiballZ_ios_facts.py
<172.21.126.182> EXEC /bin/bash -c 'chmod u+x /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403485.2815678-2627077-159454561238274/ /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403485.2815678-2627077-159454561238274/AnsiballZ_ios_facts.py && sleep 0'
<172.21.126.182> EXEC /bin/bash -c '/usr/bin/python3 /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403485.2815678-2627077-159454561238274/AnsiballZ_ios_facts.py && sleep 0'
<172.21.126.182> EXEC /bin/bash -c 'rm -f -r /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403485.2815678-2627077-159454561238274/ > /dev/null 2>&1 && sleep 0'
ok: [CSR1000v-17.3.1a] => changed=false 
  ansible_facts:
    ansible_net_all_ipv4_addresses:
    - 172.21.126.182
...
    ansible_net_system: ios
    ansible_net_version: 17.03.01a
    ansible_network_resources: {}
  invocation:
    module_args:
      available_network_resources: false
      gather_network_resources: null
      gather_subset:
      - all
      provider: null
META: ran handlers
META: ran handlers
 ____________________________________________
< PLAY [Testing netconf connection with SSH] >
 --------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

META: ran handlers
 _________________
< TASK [set_fact] >
 -----------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

task path: playbooks/issues/netconf connection issue.yml:47
redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
redirecting (type: become) ansible.builtin.enable to ansible.netcommon.enable
<172.21.126.182> attempting to start connection
<172.21.126.182> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /usr/local/bin/ansible-connection
<172.21.126.182> local domain socket does not exist, starting it
<172.21.126.182> control socket path is /root/.ansible/pc/61adb371cc
<172.21.126.182> Loading collection ansible.netcommon from /usr/local/lib/python3.9/dist-packages/ansible_collections/ansible/netcommon
<172.21.126.182> redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
<172.21.126.182> Loading collection cisco.ios from /usr/local/lib/python3.9/dist-packages/ansible_collections/cisco/ios
<172.21.126.182> redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
<172.21.126.182> local domain socket listeners started successfully
<172.21.126.182> loaded cliconf plugin ansible_collections.cisco.ios.plugins.cliconf.ios from path /usr/local/lib/python3.9/dist-packages/ansible_collections/cisco/ios/plugins/cliconf/ios.py for network_os ios
<172.21.126.182> ssh type is set to libssh
<172.21.126.182> 
<172.21.126.182> local domain socket path is /root/.ansible/pc/61adb371cc
ok: [CSR1000v-17.3.1a] => changed=false 
  ansible_facts:
    ansible_connection: ansible.netcommon.netconf
    ansible_network_os: default
    ansible_network_cli_ssh_type: libssh
    ansible_private_key_file: /home/admin/.ssh/id_rsa_4096
    ansible_user: admin
 _____________________________________________________
< TASK [Getting running configuration and state data] >
 -----------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

task path: playbooks/issues/netconf connection issue.yml:53
redirecting (type: netconf) ansible.builtin.default to ansible.netcommon.default
redirecting (type: become) ansible.builtin.enable to ansible.netcommon.enable
<172.21.126.182> attempting to start connection
<172.21.126.182> using connection plugin ansible.netcommon.netconf
Found ansible-connection at path /usr/local/bin/ansible-connection
<172.21.126.182> local domain socket does not exist, starting it
<172.21.126.182> control socket path is /root/.ansible/pc/1077d69e98
<172.21.126.182> Loading collection ansible.netcommon from /usr/local/lib/python3.9/dist-packages/ansible_collections/ansible/netcommon
<172.21.126.182> redirecting (type: netconf) ansible.builtin.default to ansible.netcommon.default
<172.21.126.182> local domain socket listeners started successfully
<172.21.126.182> loaded netconf plugin ansible_collections.ansible.netcommon.plugins.netconf.default from path /usr/local/lib/python3.9/dist-packages/ansible_collections/ansible/netcommon/plugins/netconf/default.py for network_os default
<172.21.126.182> 
<172.21.126.182> local domain socket path is /root/.ansible/pc/1077d69e98
redirecting (type: action) ansible.builtin.netconf to ansible.netcommon.netconf
<172.21.126.182> Using network group action netconf for netconf_get
redirecting (type: action) ansible.builtin.netconf to ansible.netcommon.netconf
<172.21.126.182> ANSIBLE_NETWORK_IMPORT_MODULES: disabled
<172.21.126.182> ANSIBLE_NETWORK_IMPORT_MODULES: module execution time may be extended
<172.21.126.182> ESTABLISH LOCAL CONNECTION FOR USER: root
<172.21.126.182> EXEC /bin/bash -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-local-2626466p6ejwzuc `"&& mkdir "` echo /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495 `" && echo ansible-tmp-1646403489.7821393-2627745-256277023832495="` echo /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.netconf_get to ansible.netcommon.netconf_get
Using module file /usr/local/lib/python3.9/dist-packages/ansible_collections/ansible/netcommon/plugins/modules/netconf_get.py
<172.21.126.182> PUT /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/tmptf9xysbp TO /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495/AnsiballZ_netconf_get.py
<172.21.126.182> EXEC /bin/bash -c 'chmod u+x /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495/ /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495/AnsiballZ_netconf_get.py && sleep 0'
<172.21.126.182> EXEC /bin/bash -c '/usr/bin/python3 /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495/AnsiballZ_netconf_get.py && sleep 0'
<172.21.126.182> EXEC /bin/bash -c 'rm -f -r /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495/AnsiballZ_netconf_get.py", line 107, in <module>
    _ansiballz_main()
  File "/root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495/AnsiballZ_netconf_get.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495/AnsiballZ_netconf_get.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.ansible.netcommon.plugins.modules.netconf_get', init_globals=dict(_module_fqn='ansible_collections.ansible.netcommon.plugins.modules.netconf_get', _modlib_path=modlib_path),
  File "/usr/lib/python3.9/runpy.py", line 210, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_netconf_get_payload_jvnzab02/ansible_netconf_get_payload.zip/ansible_collections/ansible/netcommon/plugins/modules/netconf_get.py", line 419, in <module>
  File "/tmp/ansible_netconf_get_payload_jvnzab02/ansible_netconf_get_payload.zip/ansible_collections/ansible/netcommon/plugins/modules/netconf_get.py", line 310, in main
  File "/tmp/ansible_netconf_get_payload_jvnzab02/ansible_netconf_get_payload.zip/ansible_collections/ansible/netcommon/plugins/module_utils/network/netconf/netconf.py", line 60, in get_capabilities
  File "/tmp/ansible_netconf_get_payload_jvnzab02/ansible_netconf_get_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
ansible.module_utils.connection.ConnectionError: name 'known_hosts_lookup' is not defined
fatal: [CSR1000v-17.3.1a]: FAILED! => changed=false 
  module_stderr: |-
    Traceback (most recent call last):
      File "/root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495/AnsiballZ_netconf_get.py", line 107, in <module>
        _ansiballz_main()
      File "/root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495/AnsiballZ_netconf_get.py", line 99, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403489.7821393-2627745-256277023832495/AnsiballZ_netconf_get.py", line 47, in invoke_module
        runpy.run_module(mod_name='ansible_collections.ansible.netcommon.plugins.modules.netconf_get', init_globals=dict(_module_fqn='ansible_collections.ansible.netcommon.plugins.modules.netconf_get', _modlib_path=modlib_path),
      File "/usr/lib/python3.9/runpy.py", line 210, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
        _run_code(code, mod_globals, init_globals,
      File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_netconf_get_payload_jvnzab02/ansible_netconf_get_payload.zip/ansible_collections/ansible/netcommon/plugins/modules/netconf_get.py", line 419, in <module>
      File "/tmp/ansible_netconf_get_payload_jvnzab02/ansible_netconf_get_payload.zip/ansible_collections/ansible/netcommon/plugins/modules/netconf_get.py", line 310, in main
      File "/tmp/ansible_netconf_get_payload_jvnzab02/ansible_netconf_get_payload.zip/ansible_collections/ansible/netcommon/plugins/module_utils/network/netconf/netconf.py", line 60, in get_capabilities
      File "/tmp/ansible_netconf_get_payload_jvnzab02/ansible_netconf_get_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
    ansible.module_utils.connection.ConnectionError: name 'known_hosts_lookup' is not defined
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1
...ignoring
META: ran handlers
META: ran handlers
 _______________________________________________
< PLAY [Testing netconf connection without SSH] >
 -----------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

META: ran handlers
 _________________
< TASK [set_fact] >
 -----------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

task path: playbooks/issues/netconf connection issue.yml:62
redirecting (type: netconf) ansible.builtin.default to ansible.netcommon.default
redirecting (type: become) ansible.builtin.enable to ansible.netcommon.enable
<172.21.126.182> attempting to start connection
<172.21.126.182> using connection plugin ansible.netcommon.netconf
Found ansible-connection at path /usr/local/bin/ansible-connection
<172.21.126.182> local domain socket does not exist, starting it
<172.21.126.182> control socket path is /root/.ansible/pc/1077d69e98
<172.21.126.182> Loading collection ansible.netcommon from /usr/local/lib/python3.9/dist-packages/ansible_collections/ansible/netcommon
<172.21.126.182> redirecting (type: netconf) ansible.builtin.default to ansible.netcommon.default
<172.21.126.182> local domain socket listeners started successfully
<172.21.126.182> loaded netconf plugin ansible_collections.ansible.netcommon.plugins.netconf.default from path /usr/local/lib/python3.9/dist-packages/ansible_collections/ansible/netcommon/plugins/netconf/default.py for network_os default
<172.21.126.182> 
<172.21.126.182> local domain socket path is /root/.ansible/pc/1077d69e98
ok: [CSR1000v-17.3.1a] => changed=false 
  ansible_facts:
    ansible_connection: ansible.netcommon.netconf
    ansible_network_os: default
    ansible_password: password
    ansible_private_key_file: null
    ansible_user: admin
 _____________________________________________________
< TASK [Getting running configuration and state data] >
 -----------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

task path: playbooks/issues/netconf connection issue.yml:69
redirecting (type: netconf) ansible.builtin.default to ansible.netcommon.default
redirecting (type: become) ansible.builtin.enable to ansible.netcommon.enable
<172.21.126.182> attempting to start connection
<172.21.126.182> using connection plugin ansible.netcommon.netconf
Found ansible-connection at path /usr/local/bin/ansible-connection
<172.21.126.182> found existing local domain socket, using it!
<172.21.126.182> 
<172.21.126.182> local domain socket path is /root/.ansible/pc/1077d69e98
redirecting (type: action) ansible.builtin.netconf to ansible.netcommon.netconf
<172.21.126.182> Using network group action netconf for netconf_get
redirecting (type: action) ansible.builtin.netconf to ansible.netcommon.netconf
<172.21.126.182> ANSIBLE_NETWORK_IMPORT_MODULES: disabled
<172.21.126.182> ANSIBLE_NETWORK_IMPORT_MODULES: module execution time may be extended
<172.21.126.182> ESTABLISH LOCAL CONNECTION FOR USER: root
<172.21.126.182> EXEC /bin/bash -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-local-2626466p6ejwzuc `"&& mkdir "` echo /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240 `" && echo ansible-tmp-1646403491.357617-2627964-1231873294240="` echo /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240 `" ) && sleep 0'
redirecting (type: modules) ansible.builtin.netconf_get to ansible.netcommon.netconf_get
Using module file /usr/local/lib/python3.9/dist-packages/ansible_collections/ansible/netcommon/plugins/modules/netconf_get.py
<172.21.126.182> PUT /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/tmp6em9ul5k TO /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240/AnsiballZ_netconf_get.py
<172.21.126.182> EXEC /bin/bash -c 'chmod u+x /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240/ /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240/AnsiballZ_netconf_get.py && sleep 0'
<172.21.126.182> EXEC /bin/bash -c '/usr/bin/python3 /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240/AnsiballZ_netconf_get.py && sleep 0'
<172.21.126.182> EXEC /bin/bash -c 'rm -f -r /root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240/AnsiballZ_netconf_get.py", line 107, in <module>
    _ansiballz_main()
  File "/root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240/AnsiballZ_netconf_get.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240/AnsiballZ_netconf_get.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.ansible.netcommon.plugins.modules.netconf_get', init_globals=dict(_module_fqn='ansible_collections.ansible.netcommon.plugins.modules.netconf_get', _modlib_path=modlib_path),
  File "/usr/lib/python3.9/runpy.py", line 210, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_netconf_get_payload_s724lwqp/ansible_netconf_get_payload.zip/ansible_collections/ansible/netcommon/plugins/modules/netconf_get.py", line 419, in <module>
  File "/tmp/ansible_netconf_get_payload_s724lwqp/ansible_netconf_get_payload.zip/ansible_collections/ansible/netcommon/plugins/modules/netconf_get.py", line 310, in main
  File "/tmp/ansible_netconf_get_payload_s724lwqp/ansible_netconf_get_payload.zip/ansible_collections/ansible/netcommon/plugins/module_utils/network/netconf/netconf.py", line 60, in get_capabilities
  File "/tmp/ansible_netconf_get_payload_s724lwqp/ansible_netconf_get_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
ansible.module_utils.connection.ConnectionError: name 'known_hosts_lookup' is not defined
fatal: [CSR1000v-17.3.1a]: FAILED! => changed=false 
  module_stderr: |-
    Traceback (most recent call last):
      File "/root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240/AnsiballZ_netconf_get.py", line 107, in <module>
        _ansiballz_main()
      File "/root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240/AnsiballZ_netconf_get.py", line 99, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/root/.ansible/tmp/ansible-local-2626466p6ejwzuc/ansible-tmp-1646403491.357617-2627964-1231873294240/AnsiballZ_netconf_get.py", line 47, in invoke_module
        runpy.run_module(mod_name='ansible_collections.ansible.netcommon.plugins.modules.netconf_get', init_globals=dict(_module_fqn='ansible_collections.ansible.netcommon.plugins.modules.netconf_get', _modlib_path=modlib_path),
      File "/usr/lib/python3.9/runpy.py", line 210, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
        _run_code(code, mod_globals, init_globals,
      File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_netconf_get_payload_s724lwqp/ansible_netconf_get_payload.zip/ansible_collections/ansible/netcommon/plugins/modules/netconf_get.py", line 419, in <module>
      File "/tmp/ansible_netconf_get_payload_s724lwqp/ansible_netconf_get_payload.zip/ansible_collections/ansible/netcommon/plugins/modules/netconf_get.py", line 310, in main
      File "/tmp/ansible_netconf_get_payload_s724lwqp/ansible_netconf_get_payload.zip/ansible_collections/ansible/netcommon/plugins/module_utils/network/netconf/netconf.py", line 60, in get_capabilities
      File "/tmp/ansible_netconf_get_payload_s724lwqp/ansible_netconf_get_payload.zip/ansible/module_utils/connection.py", line 200, in __rpc__
    ansible.module_utils.connection.ConnectionError: name 'known_hosts_lookup' is not defined
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1
...ignoring
META: ran handlers
META: ran handlers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants