1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/eos_l2_interface/tests/cli/basic.yaml
Ricardo Carrillo Cruz 33c4351a35
Add authorize and provider params to eos_l2_interface tests (#35249)
Otherwise this fail for connection local
2018-01-23 22:45:17 +01:00

140 lines
2.8 KiB
YAML

---
- debug: msg="START eos_l2_interface cli/basic.yaml on connection={{ ansible_connection }}"
- name: Delete test interface switchports
eos_l2_interface:
name: Ethernet1
state: absent
authorize: yes
provider: "{{ cli }}"
become: yes
- name: Set switchport mode to access on vlan 4000
eos_l2_interface:
name: Ethernet1
state: present
mode: access
access_vlan: 4000
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == true'
- name: Set switchport mode to access on vlan 4000 again (idempotent)
eos_l2_interface:
name: Ethernet1
state: present
mode: access
access_vlan: 4000
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == false'
- name: Change access vlan to 4001
eos_l2_interface:
name: Ethernet1
state: present
mode: access
access_vlan: 4001
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == true'
- name: Change access vlan to 4001 again (idempotent)
eos_l2_interface:
name: Ethernet1
state: present
mode: access
access_vlan: 4001
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == false'
- name: Change switchport mode to trunk and set native vlan to 4001
eos_l2_interface:
name: Ethernet1
state: present
mode: trunk
native_vlan: 4001
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == true'
- name: Change switchport mode to trunk and set native vlan to 4001 again (idempotent)
eos_l2_interface:
name: Ethernet1
state: present
mode: trunk
native_vlan: 4001
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == false'
- name: Set trunk allowed vlans to 20 and 4000
eos_l2_interface:
name: Ethernet1
state: present
mode: trunk
trunk_allowed_vlans: 20,4000
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == true'
- name: Set trunk allowed vlans to 20 and 4000 again (idempotent)
eos_l2_interface:
name: Ethernet1
state: present
mode: trunk
trunk_allowed_vlans: 20,4000
authorize: yes
provider: "{{ cli }}"
become: yes
register: result
- assert:
that:
- 'result.changed == false'
- name: Tear down switchports
eos_l2_interface:
name: Ethernet1
state: absent
authorize: yes
provider: "{{ cli }}"
become: yes
- debug: msg="END eos_l3_interface cli/basic.yaml on connection={{ ansible_connection }}"