Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - name: Show interface
- ios_command:
- commands:
- - show interface
- host: "{{ inventory_hostname }}"
- password: "{{ cisco.nexus.password }}"
- username: "{{ cisco.nexus.username }}"
- register: interfaces
- - name: Set physical interface and port-channel names
- set_fact: interface_names="{{ interfaces.stdout[0] | regex_findall('\n([GTEP][\w\-]+/?\d+)') }}"
- - name: Check interface status
- ios_command:
- commands:
- - "show interface {{ item }}"
- host: "{{ inventory_hostname }}"
- password: "{{ cisco.nexus.password }}"
- username: "{{ cisco.nexus.username }}"
- waitfor: "result[0] contains connected"
- with_items: "{{ interface_names }}"
- ignore_errors: yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement