ansible-collections / community.network

Ansible Community Network Collection
http://galaxy.ansible.com/community/network
Other
125 stars 90 forks source link

aireos_command throws Unable to decode JSON from response to exec_command when password starts with # (hash) symbol #597

Open lexxnsk opened 9 months ago

lexxnsk commented 9 months ago
SUMMARY

aireos_command doesn't work when password starts with # (hash) symbol

ISSUE TYPE
COMPONENT NAME

community.network 5.0.2

ANSIBLE VERSION

ansible [core 2.14.2] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/xxxxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3.11/site-packages/ansible ansible collection location = /home/xxxxx/.ansible/collections:/usr/share/ansible/collections executable location = /usr/bin/ansible python version = 3.11.2 (main, Jun 6 2023, 07:39:01) [GCC 8.5.0 20210514 (Red Hat 8.5.0-18)] (/usr/bin/python3.11) jinja version = 3.1.2 libyaml = True

COLLECTION VERSION

# /home/xxxxx/.ansible/collections/ansible_collections Collection Version


ansible.netcommon 5.1.1
ansible.utils 2.10.3 cisco.asa 4.0.3
community.general 8.2.0
community.network 5.0.2
paloaltonetworks.panos 2.19.1

# /usr/share/ansible/collections/ansible_collections Collection Version


ansible.netcommon 5.3.0
ansible.utils 2.11.0 cisco.aci 2.8.0
cisco.asa 4.0.3
cisco.dnac 6.7.6
cisco.ios 5.2.0
cisco.nxos 5.2.1
f5networks.f5_modules 1.27.0 freedge.acs 0.1.13 junipernetworks.junos 5.3.0
paloaltonetworks.panos 2.17.8

CONFIGURATION

CONFIG_FILE() = /etc/ansible/ansible.cfg DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 5 HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False

OS / ENVIRONMENT

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8" REDHAT_BUGZILLA_PRODUCT_VERSION=8.8

STEPS TO REPRODUCE

ansible_ssh_pass variable should contain a password, staring with # sign Then, you get a reply: fatal: [xxxxxxxxxxxxxxxxxxx]: FAILED! => {"changed": false, "msg": "Unable to decode JSON from response to exec_command('{\"command\": \"show sysinfo\", \"prompt\": null, \"answer\": null}'). Received 'None'.", "rc": 1}

EXPECTED RESULTS

Reply should contain command printout

ACTUAL RESULTS

(fatal: [xxxxxxxxxxxxxxxxxxx]: FAILED! => {"changed": false, "msg": "Unable to decode JSON from response to exec_command('{\"command\": \"show sysinfo\", \"prompt\": null, \"answer\": null}'). Received 'None'.", "rc": 1})

Andersson007 commented 9 months ago

@lexxnsk hello, thanks for opening the issue! You mention the following as the component name

ansible.netcommon 5.1.1
ansible.netcommon 5.3.0

Is this just a copy paste thing or you think the issue can relate to the ansible.netcommon collection?

lexxnsk commented 9 months ago

You're right. Aireos_command is a part of community.network module

Andersson007 commented 9 months ago

You're right. Aireos_command is a part of community.network module

@lexxnsk i'm a bit confused:) I see that the aireos_command module is a part of this (community.network) collection. It uses some code from ansible.netcommon though. So not sure whether it relates to this collection or to the ansible.netcommon collection.

Anyway, @jmighion as an author would you like to take a look? thanks

jmighion commented 9 months ago

@Andersson007 Sorry, it has been many years since I originally wrote any network modules and have since passed on that ownership to the Ansible networking team. I no longer have access to any network devices even if I had the time to contribute here.

Andersson007 commented 8 months ago

@jmighion hi, thanks for the feedback! sure, no worries So now it's vacant then, here's a quick start guide if anyone wants to fix it.