309a58eafd
* Add [junos_l2_interfaces] resource module * Add new resource module junos_lag_interfaces. * Targets model https://github.com/ansible-network/resource_module_models/pull/12 * Deprecate junos_l2_interface module * Fix CI failures * Fix CI issues
70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
---
|
|
- debug:
|
|
msg: "START junos_l2_interfaces round trip integration tests on connection={{ ansible_connection }}"
|
|
|
|
- include_tasks: _remove_config.yaml
|
|
- include_tasks: _base_config.yaml
|
|
|
|
- set_fact:
|
|
expected_revert_output:
|
|
- name: ge-0/0/2
|
|
trunk:
|
|
allowed_vlans:
|
|
- vlan100
|
|
native_vlan: "200"
|
|
enhanced_layer: True
|
|
unit: 0
|
|
|
|
- block:
|
|
- name: Apply the provided configuration (base config)
|
|
junos_l2_interfaces:
|
|
config:
|
|
- name: ge-0/0/2
|
|
trunk:
|
|
allowed_vlans:
|
|
- vlan100
|
|
native_vlan: "200"
|
|
state: merged
|
|
register: base_config
|
|
|
|
- name: Gather interfaces facts
|
|
junos_facts:
|
|
gather_subset:
|
|
- default
|
|
gather_network_resources:
|
|
- l2_interfaces
|
|
|
|
- name: Apply the provided configuration (config to be reverted)
|
|
junos_l2_interfaces:
|
|
config:
|
|
- name: ge-0/0/1
|
|
trunk:
|
|
allowed_vlans:
|
|
- vlan100
|
|
- vlan300
|
|
native_vlan: "400"
|
|
- name: ge-0/0/2
|
|
access:
|
|
vlan: vlan200
|
|
state: replaced
|
|
register: result
|
|
|
|
- name: Assert that changes were applied
|
|
assert:
|
|
that: "result['changed'] == true"
|
|
|
|
- name: Revert back to base config using facts round trip
|
|
junos_l2_interfaces:
|
|
config: "{{ ansible_facts['network_resources']['l2_interfaces'] }}"
|
|
state: overridden
|
|
register: revert
|
|
|
|
- name: Assert that config was reverted
|
|
assert:
|
|
that: "{{ expected_revert_output | symmetric_difference(revert['after']) |length == 0 }}"
|
|
|
|
always:
|
|
- include_tasks: _remove_config.yaml
|
|
|
|
- debug:
|
|
msg: "END junos_l2_interfaces round trip integration tests on connection={{ ansible_connection }}"
|