2017-01-20 21:18:12 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Ensure we have loopback 888 for testing
|
|
|
|
ios_config:
|
|
|
|
src: config.j2
|
2017-12-20 15:03:29 +01:00
|
|
|
connection: network_cli
|
|
|
|
become: yes
|
2017-01-20 21:18:12 +01:00
|
|
|
|
|
|
|
# Some AWS hostnames can be longer than those allowed by the system we are testing
|
|
|
|
# Truncate the hostname
|
|
|
|
# http://jinja.pocoo.org/docs/2.9/templates/#truncate
|
|
|
|
- set_fact:
|
|
|
|
shorter_hostname: '{{ inventory_hostname_short| truncate(10, True, "") }}'
|
2018-01-11 08:03:15 +01:00
|
|
|
|
|
|
|
- name: "Discover IOS L2/L3 switch type"
|
|
|
|
ios_command:
|
|
|
|
commands: ['show version']
|
|
|
|
connection: network_cli
|
|
|
|
become: yes
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- set_fact: switch_type=""
|
|
|
|
|
|
|
|
- set_fact: switch_type="L2"
|
|
|
|
when: '"l2" in result.stdout[0]'
|