2019-08-21 09:00:13 +02:00
|
|
|
---
|
|
|
|
- debug:
|
2019-12-03 15:34:35 +01:00
|
|
|
msg: "START vyos_lldp_interfaces merged integration tests on connection={{ ansible_connection }}"
|
2019-08-21 09:00:13 +02:00
|
|
|
|
|
|
|
- include_tasks: _remove_config.yaml
|
|
|
|
|
|
|
|
- block:
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Merge the provided configuration with the exisiting running configuration
|
|
|
|
vyos_lldp_interfaces: &merged
|
2019-08-21 09:00:13 +02:00
|
|
|
config:
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: 'eth1'
|
|
|
|
location:
|
|
|
|
civic_based:
|
|
|
|
country_code: 'US'
|
|
|
|
ca_info:
|
|
|
|
- ca_type: 0
|
|
|
|
ca_value: 'ENGLISH'
|
|
|
|
|
|
|
|
- name: 'eth2'
|
|
|
|
location:
|
|
|
|
coordinate_based:
|
|
|
|
altitude: 2200
|
2019-08-21 09:00:13 +02:00
|
|
|
datum: 'WGS84'
|
|
|
|
longitude: '222.267255W'
|
2019-12-03 15:34:35 +01:00
|
|
|
latitude: '33.524449N'
|
2019-08-21 09:00:13 +02:00
|
|
|
state: merged
|
2019-12-03 15:34:35 +01:00
|
|
|
register: result
|
2019-08-21 09:00:13 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Assert that before dicts were correctly generated
|
|
|
|
assert:
|
2019-08-21 09:00:13 +02:00
|
|
|
that: "{{ merged['before'] | symmetric_difference(result['before']) |length == 0 }}"
|
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Assert that correct set of commands were generated
|
|
|
|
assert:
|
2019-08-21 09:00:13 +02:00
|
|
|
that:
|
2019-12-03 15:34:35 +01:00
|
|
|
- "{{ merged['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
|
2019-08-21 09:00:13 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Assert that after dicts was correctly generated
|
|
|
|
assert:
|
2019-08-21 09:00:13 +02:00
|
|
|
that:
|
2019-12-03 15:34:35 +01:00
|
|
|
- "{{ merged['after'] | symmetric_difference(result['after']) |length == 0 }}"
|
2019-08-21 09:00:13 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Merge the provided configuration with the existing running configuration (IDEMPOTENT)
|
|
|
|
vyos_lldp_interfaces: *merged
|
|
|
|
register: result
|
2019-08-21 09:00:13 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Assert that the previous task was idempotent
|
|
|
|
assert:
|
2019-08-21 09:00:13 +02:00
|
|
|
that:
|
2019-12-03 15:34:35 +01:00
|
|
|
- "result['changed'] == false"
|
2019-08-21 09:00:13 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Assert that before dicts were correctly generated
|
|
|
|
assert:
|
2019-08-21 09:00:13 +02:00
|
|
|
that:
|
2019-12-03 15:34:35 +01:00
|
|
|
- "{{ merged['after'] | symmetric_difference(result['before']) |length == 0 }}"
|
2019-08-21 09:00:13 +02:00
|
|
|
|
|
|
|
always:
|
2019-12-03 15:34:35 +01:00
|
|
|
- include_tasks: _remove_config.yaml
|