ansible-network/cisco_nxos

Error stop playbook

Opened this issue · 0 comments

Hello,

I try to create a task / playbook to deploy a vlan on a switch but some command stops me the execution of the task while that the output of the command is good.

Do you have an idea ?

`

  • hosts: NEXUS
    gather_facts: no
    connection: local
    tasks:
    • name: Add vlan Nexus
      nxos_command:
      commands:
      - show version
      - show vlan id {{ id_vlan }}
      - configure terminal
      - vlan {{ id_vlan }}
      - name {{ name_vlan }}
      - exit
      - exit
      - copy running-config startup-config
      wait_for:
      - result[0] contains Nexus
      - result[1] contains found
      - result[2] contains configuration
      - result[6] contains 100%

ansible-playbook -i hosts.yml tasks/add_vlan_nexus.yml -e 'id_vlan="242"' -e 'name_vlan="test"' --verbose`

error:
`fatal: [NEXUS2]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": "show vlan id 242\r\r\nVLAN 242 not found in current VLAN database\r\n\rswitch# "}

The output with the cli of the switch :

Is a normal output not en error beacause the vlan don't exist

Thank'you