aruba / aoscx-ansible-collection

Ansible collections for AOS-CX switches 
43 stars 23 forks source link

aoscx_command returns OK even though it failed #70

Open KBerstene opened 1 year ago

KBerstene commented 1 year ago

I attempted to run the aoscx_command and the command reported an OK status, but in reality it failed to authenticate (misconfigured password, that part is irrelevant). It should be reporting a failed status instead of an OK status.

I also was attempting to save the configuration using aoscs_config in the same playbook and that reported the failure correctly.

The command in question:

  tasks:
    - name: Set Hostname
      aoscx_command:
        commands:
          - config
          - "hostname {{ inventory_hostname }}"
ok: [example_host] => changed=false
  invocation:
    module_args:
      commands:
      - config
      - hostname ExampleHost
      interval: 1
      match: all
      output_file: null
      output_file_format: json
      provider: null
      retries: 10
      wait_for: null
  stdout:
  - 'Failed to authenticate: Authentication failed.'
  - 'Failed to authenticate: Authentication failed.'
  stdout_lines: <omitted>
tchiapuziowong commented 1 year ago

Thank you for bringing this to our attention! I'll bring this up internally and will update the issue as our work progresses.