ansible-collections / cisco.ios

Ansible Network Collection for Cisco IOS
GNU General Public License v3.0
294 stars 171 forks source link

Cisco CSR1000V IOS-XE: Delayed Prompt Issue #882

Closed Akasurde closed 1 year ago

Akasurde commented 1 year ago

Hi,

I have similar issue , trying to apply below command and script but it fails please help.

- name: Configure class-map command
  hosts: cisco_ios_devices
  gather_facts: no
  connection: network_cli

  tasks:
    - name: Enter configuration mode
      ios_command:
        commands:
          - command: "class-map type control subscriber match-all DOT1X_FAILED"
            prompt: "Do you wish to continue?"
            answer: "yes"

ERROR:

TASK [Enter configuration mode] ***** fatal: [CSRR1]: FAILED! => {"changed": false, "msg": "class-map type control subscriber match-all DOT1X_FAILED\r\nclass-map type control subscriber match-all DOT1X_FAILED\r\n ^\r\n% Invalid input detected at '^' marker.\r\n\r\nCSRR1#"}

### Tasks
Akasurde commented 1 year ago

cc @vjs-tec

KB-perByte commented 1 year ago

@Akasurde The command being used is a configuration command, I see the need for prompt we may supply the configuration terminal command from the command module itself.

- name: Configure class-map command
  hosts: ios
  gather_facts: no
  connection: network_cli

  tasks:
    - name: Enter configuration mode
      cisco.ios.ios_command:
        commands:
          - command: "configure terminal"
          - command: "class-map type control subscriber match-all DOT1X_FAILED"
            prompt: "Do you wish to continue?"
            answer: "yes"

Regards