You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a configuration that is the exact same config on the host BUT I changed the line hostname test to hostvar test. The error would show on console if I connect to the device manually and apply. I also recall it shows for other provider/collections like arista.eos, but it does not here. Instead it shows a output in the std diff presented by ansible of:
@ryanmerolle I'm not sure if I fully understand the issue here. The task you mentioned, does not seem to run the diff commands on the device (it merely calculates the diff). As such, the error reported by CLI (on execution of the erroneous command) won't be known to Ansible and it won't fail.
Can you please elaborate on what you think is not working here? Thanks.
I thought the nxos config role uses config sessions to apply the config and revert it, given the check_mode being set, like the equivalent eos role does. If it did do that, I would imagine the error message would be available to ansible. At least that’s how it works when I manually test this process on the remote host by using config sessions and applying the config, then canceling the config session.
NilashishC
removed
the
needs_info
This issue requires further information. Please answer any outstanding questions.
label
Jan 8, 2024
@ryanmerolle The nxos_config module does not use on-box session based diff capabilities for this. It relies on standard AnsibleModule class diffing logic (which uses difflib). As far as I understand, the config session capabilities on NX-OS are limited even on the 10.3.x train. Can you share the steps you're performing manually on the CLI for this? Thanks!
SUMMARY
invalid commands do not error with the following task:
I have a configuration that is the exact same config on the host BUT I changed the line
hostname test
tohostvar test
. The error would show on console if I connect to the device manually and apply. I also recall it shows for other provider/collections likearista.eos
, but it does not here. Instead it shows a output in the std diff presented by ansible of:ISSUE TYPE
COMPONENT NAME
cisco.nxos.nxos_config
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Cisco NXOS 10.2(6)
STEPS TO REPRODUCE
See summary
EXPECTED RESULTS
Task failure pointing out the line with issues similar to arista.eos collection or manually doing this on the cli.
ACTUAL RESULTS
See summary
The text was updated successfully, but these errors were encountered: