Advertisement
Guest User

Untitled

a guest
Apr 14th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. ---
  2. - name: Show interface
  3. ios_command:
  4. commands:
  5. - show interface
  6. host: "{{ inventory_hostname }}"
  7. password: "{{ cisco.nexus.password }}"
  8. username: "{{ cisco.nexus.username }}"
  9. register: interfaces
  10.  
  11. - name: Set physical interface and port-channel names
  12. set_fact: interface_names="{{ interfaces.stdout[0] | regex_findall('\n([GTEP][\w\-]+/?\d+)') }}"
  13.  
  14. - name: Check interface status
  15. ios_command:
  16. commands:
  17. - "show interface {{ item }}"
  18. host: "{{ inventory_hostname }}"
  19. password: "{{ cisco.nexus.password }}"
  20. username: "{{ cisco.nexus.username }}"
  21. waitfor: "result[0] contains connected"
  22. with_items: "{{ interface_names }}"
  23. ignore_errors: yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement