mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
2.3 KiB
YAML
91 lines
2.3 KiB
YAML
---
|
|
- debug:
|
|
msg: "START junos_lacp_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: ae1
|
|
period: slow
|
|
sync_reset: disable
|
|
system:
|
|
priority: 10
|
|
mac:
|
|
address: 00:00:00:00:00:03
|
|
- name: ae2
|
|
period: fast
|
|
system:
|
|
priority: 300
|
|
- name: ge-0/0/2
|
|
port_priority: 250
|
|
force_up: True
|
|
- name: ge-0/0/4
|
|
port_priority: 400
|
|
force_up: True
|
|
|
|
- block:
|
|
- name: Apply the provided configuration (base config)
|
|
junos_lacp_interfaces:
|
|
config:
|
|
- name: ae1
|
|
period: slow
|
|
sync_reset: disable
|
|
system:
|
|
priority: 10
|
|
mac:
|
|
address: 00:00:00:00:00:03
|
|
- name: ge-0/0/2
|
|
port_priority: 250
|
|
force_up: False
|
|
- name: ae2
|
|
period: fast
|
|
system:
|
|
priority: 300
|
|
- name: ge-0/0/4
|
|
port_priority: 400
|
|
force_up: True
|
|
state: merged
|
|
register: base_config
|
|
|
|
- name: Gather interfaces facts
|
|
junos_facts:
|
|
gather_subset:
|
|
- default
|
|
gather_network_resources:
|
|
- lacp_interfaces
|
|
|
|
- name: Apply the provided configuration (config to be reverted)
|
|
junos_lacp_interfaces:
|
|
config:
|
|
- name: ae1
|
|
period: fast
|
|
sync_reset: enable
|
|
system:
|
|
priority: 100
|
|
mac:
|
|
address: 00:00:00:00:00:01
|
|
state: merged
|
|
register: result
|
|
|
|
- name: Assert that changes were applied
|
|
assert:
|
|
that: "result['changed'] == true"
|
|
|
|
- name: Revert back to base config using facts round trip
|
|
junos_lacp_interfaces:
|
|
config: "{{ ansible_facts['network_resources']['lacp_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_lacp_interfaces round trip integration tests on connection={{ ansible_connection }}"
|