ansible-collections / ansible.netcommon

Ansible Network Collection for Common Code
GNU General Public License v3.0
143 stars 103 forks source link

cli_config - Return commands already sent to device on failure in commands variable #478

Open mitchmahan opened 1 year ago

mitchmahan commented 1 year ago
SUMMARY

Upon a successful cli_config run the module returns the 'commands' variable which lists the commands that were sent to the device. If one of those commands fails, say the 3rd command, no commands variable is returned.

This fails to let the user know which commands may have been sent to the device.

ISSUE TYPE
COMPONENT NAME

ansible.netcommon.cli_config

ADDITIONAL INFORMATION

This would solve issues when using the cli_config module and trying to guess which commands were or were not sent upon failure.

task:
  ansible.netcommon.cli_config:
    commands = |
      snmp-server community test
      snmp-bad command
      snmp-server community test2

Module should return snmp-server community test in commands list. Perhaps even add a failed_commands list?

mpaccione commented 1 year ago

Hi Kate, would like to see this implemented as well. @Qalthos