2019-08-21 09:00:13 +02:00
|
|
|
---
|
|
|
|
- debug:
|
2019-12-03 15:34:35 +01:00
|
|
|
msg: "START vyos_lldp_interfaces overridden integration tests on connection={{ ansible_connection }}"
|
2019-08-21 09:00:13 +02:00
|
|
|
|
|
|
|
- include_tasks: _remove_config.yaml
|
|
|
|
|
|
|
|
- include_tasks: _populate_intf.yaml
|
|
|
|
|
|
|
|
- block:
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Overrides all device configuration with provided configuration
|
|
|
|
vyos_lldp_interfaces: &overridden
|
|
|
|
config:
|
|
|
|
- name: 'eth2'
|
|
|
|
location:
|
|
|
|
elin: '0000000911'
|
|
|
|
state: overridden
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- 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
|
|
|
- "{{ populate_intf | symmetric_difference(result['before']) |length == 0 }}"
|
2019-08-21 09:00:13 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Assert that correct commands were generated
|
|
|
|
assert:
|
2019-08-21 09:00:13 +02:00
|
|
|
that:
|
2019-12-03 15:34:35 +01:00
|
|
|
- "{{ overridden['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 were correctly generated
|
|
|
|
assert:
|
2019-08-21 09:00:13 +02:00
|
|
|
that:
|
2019-12-03 15:34:35 +01:00
|
|
|
- "{{ overridden['after'] | symmetric_difference(result['after']) |length == 0 }}"
|
2019-08-21 09:00:13 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Overrides all device configuration with provided configurations (IDEMPOTENT)
|
|
|
|
vyos_lldp_interfaces: *overridden
|
|
|
|
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
|
|
|
- "{{ overridden['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
|