cisco_nxos icon indicating copy to clipboard operation
cisco_nxos copied to clipboard

Error stop playbook

Open mabed-fr opened this issue 4 years ago • 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

mabed-fr avatar Feb 17 '20 19:02 mabed-fr