community.network icon indicating copy to clipboard operation
community.network copied to clipboard

Unable to decode JSON - Commands executed locally instead of on switch

Open jnm27 opened this issue 3 years ago • 3 comments

SUMMARY

I am trying to use the aruba module with network_cli and am unable to run aruba_config on it. Looking through the code, it appears that it is calling exec_command from the base connection plugin, which simply calls the local connection plugin. So I don't see how it would work. Maybe I am wrong though.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

aruba_config

ANSIBLE VERSION
ansible --version
ansible [core 2.11.0]
  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.8/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.3 (default, Aug 18 2020, 08:56:04) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
  jinja version = 3.0.0
  libyaml = True
COLLECTION VERSION
# /usr/share/ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.network 3.0.0
CONFIGURATION
ANSIBLE_PIPELINING(/etc/ansible/ansible.cfg) = True
BECOME_ALLOW_SAME_USER(/etc/ansible/ansible.cfg) = True
CALLBACKS_ENABLED(/etc/ansible/ansible.cfg) = <omit>
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 100
DEFAULT_LOAD_CALLBACK_PLUGINS(/etc/ansible/ansible.cfg) = True
DEFAULT_LOCAL_TMP(/etc/ansible/ansible.cfg) = /tmp/.ansible_root/ansible-local-2135591izxyfhq0
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = <omit>
DEFAULT_STRATEGY(/etc/ansible/ansible.cfg) = free
DEFAULT_VAULT_PASSWORD_FILE(/etc/ansible/ansible.cfg) = <omit>
DIFF_ALWAYS(/etc/ansible/ansible.cfg) = True
DIFF_CONTEXT(/etc/ansible/ansible.cfg) = 0
DISPLAY_SKIPPED_HOSTS(/etc/ansible/ansible.cfg) = False
DUPLICATE_YAML_DICT_KEY(/etc/ansible/ansible.cfg) = ignore
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = /usr/libexec/platform-python
LOCALHOST_WARNING(/etc/ansible/ansible.cfg) = False
MAX_FILE_SIZE_FOR_DIFF(/etc/ansible/ansible.cfg) = 10485760
VARIABLE_PLUGINS_ENABLED(/etc/ansible/ansible.cfg) = <omit>
OS / ENVIRONMENT

RHEL8.2 Aruba KB.16.01.0009

STEPS TO REPRODUCE
community.network.aruba_config with a backup option specified
EXPECTED RESULTS

Config to be updated

ACTUAL RESULTS
TASK [configurable backup path] ************************************************************************************************************************************************************************
fatal: [sw02]: FAILED! => changed=false
  msg: unable to retrieve current config
  stderr: Unable to decode JSON from response to exec_command('show running-config'). Received 'None'.
  stderr_lines: <omitted>

jnm27 avatar Jun 29 '21 20:06 jnm27

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar Nov 10 '21 06:11 ansibullbot

cc @karthikeyan-dhandapani click here for bot help

ansibullbot avatar Nov 17 '21 19:11 ansibullbot

Hello, check this #405 looks like the same issue. I found that this happens when using Libssh as Connection Plugin. By changing it and falling back to Paramiko, it has worked again. This can be done by setting this in the ansible.cfg file:

[persistent_connection] 
ssh_type = paramiko

Source: https://www.ansible.com/blog/new-libssh-connection-plugin-for-ansible-network

maticomba avatar Jun 30 '22 22:06 maticomba