2017-02-26 15:42:41 +01:00
|
|
|
---
|
2018-01-05 23:01:45 +01:00
|
|
|
- debug: msg="START connection={{ ansible_connection }}/set_mtu.yaml"
|
|
|
|
- debug: msg="Using provider={{ connection.transport }}"
|
|
|
|
when: ansible_connection == "local"
|
2017-02-26 15:42:41 +01:00
|
|
|
|
2017-09-13 07:21:46 +02:00
|
|
|
- set_fact: testint="{{ nxos_int1 }}"
|
|
|
|
|
2017-02-26 15:42:41 +01:00
|
|
|
- name: setup
|
|
|
|
nxos_config:
|
|
|
|
lines:
|
|
|
|
- no switchport
|
|
|
|
- no mtu
|
2017-09-13 07:21:46 +02:00
|
|
|
parents: "interface {{ testint }}"
|
2017-02-26 15:42:41 +01:00
|
|
|
match: none
|
2017-08-17 10:39:13 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-02-26 15:42:41 +01:00
|
|
|
|
|
|
|
- name: configure interface mtu
|
|
|
|
nxos_mtu:
|
2017-09-13 07:21:46 +02:00
|
|
|
interface: "{{ testint }}"
|
2017-02-26 15:42:41 +01:00
|
|
|
mtu: 2000
|
2017-08-17 10:39:13 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-02-26 15:42:41 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: verify interface mtu
|
|
|
|
nxos_mtu:
|
2017-09-13 07:21:46 +02:00
|
|
|
interface: "{{ testint }}"
|
2017-02-26 15:42:41 +01:00
|
|
|
mtu: 2000
|
2017-08-17 10:39:13 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-02-26 15:42:41 +01:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2017-04-06 18:26:17 +02:00
|
|
|
- name: configure invalid (odd) interface mtu
|
2017-02-26 15:42:41 +01:00
|
|
|
nxos_mtu:
|
2017-09-13 07:21:46 +02:00
|
|
|
interface: "{{ testint }}"
|
2017-02-26 15:42:41 +01:00
|
|
|
mtu: 2001
|
2017-08-17 10:39:13 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-02-26 15:42:41 +01:00
|
|
|
register: result
|
2017-04-06 18:26:17 +02:00
|
|
|
ignore_errors: yes
|
2017-02-26 15:42:41 +01:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
2017-04-06 18:26:17 +02:00
|
|
|
- "result.failed == true"
|
2017-02-26 15:42:41 +01:00
|
|
|
|
2017-04-06 18:26:17 +02:00
|
|
|
- name: configure invalid (large) mtu setting
|
2017-02-26 15:42:41 +01:00
|
|
|
nxos_mtu:
|
2017-09-13 07:21:46 +02:00
|
|
|
interface: "{{ testint }}"
|
2017-02-26 15:42:41 +01:00
|
|
|
mtu: 100000
|
2017-08-17 10:39:13 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-02-26 15:42:41 +01:00
|
|
|
register: result
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.failed == true"
|
|
|
|
|
|
|
|
- name: teardown
|
|
|
|
nxos_config:
|
|
|
|
lines: no mtu
|
2017-09-13 07:21:46 +02:00
|
|
|
parents: "interface {{ testint }}"
|
2017-02-26 15:42:41 +01:00
|
|
|
match: none
|
2017-08-17 10:39:13 +02:00
|
|
|
provider: "{{ connection }}"
|
2017-02-26 15:42:41 +01:00
|
|
|
|
2018-01-05 23:01:45 +01:00
|
|
|
- debug: msg="END connection={{ ansible_connection }}/set_mtu.yaml"
|