2019-08-19 14:01:09 +02:00
|
|
|
---
|
|
|
|
- debug:
|
2019-12-03 15:34:35 +01:00
|
|
|
msg: "START vyos_lldp_global replaced integration tests on connection={{ ansible_connection }}"
|
2019-08-19 14:01:09 +02:00
|
|
|
|
|
|
|
- include_tasks: _remove_config.yaml
|
|
|
|
|
|
|
|
- include_tasks: _populate.yaml
|
|
|
|
|
|
|
|
- block:
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Replace device configurations of LLDP service with provided configurations
|
|
|
|
vyos_lldp_global: &replaced
|
2019-08-19 14:01:09 +02:00
|
|
|
config:
|
2019-12-03 15:34:35 +01:00
|
|
|
legacy_protocols:
|
|
|
|
- 'edp'
|
|
|
|
- 'sonmp'
|
|
|
|
- 'cdp'
|
|
|
|
address: 192.0.2.14
|
2019-08-19 14:01:09 +02:00
|
|
|
state: replaced
|
2019-12-03 15:34:35 +01:00
|
|
|
register: result
|
2019-08-19 14:01:09 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Assert that correct set of commands were generated
|
|
|
|
assert:
|
2019-08-19 14:01:09 +02:00
|
|
|
that:
|
2019-12-03 15:34:35 +01:00
|
|
|
- "{{ replaced['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
|
2019-08-19 14:01:09 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Assert that before dicts are correctly generated
|
|
|
|
assert:
|
2019-08-19 14:01:09 +02:00
|
|
|
that:
|
2019-12-03 15:34:35 +01:00
|
|
|
- "{{ populate == result['before'] }}"
|
2019-08-19 14:01:09 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Assert that after dict is correctly generated
|
|
|
|
assert:
|
2019-08-19 14:01:09 +02:00
|
|
|
that:
|
2019-12-03 15:34:35 +01:00
|
|
|
- "{{ replaced['after'] == result['after'] }}"
|
2019-08-19 14:01:09 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Replace device configurations of LLDP service with provided configurarions (IDEMPOTENT)
|
|
|
|
vyos_lldp_global: *replaced
|
|
|
|
register: result
|
2019-08-19 14:01:09 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Assert that task was idempotent
|
|
|
|
assert:
|
2019-08-19 14:01:09 +02:00
|
|
|
that:
|
2019-12-03 15:34:35 +01:00
|
|
|
- "result['changed'] == false"
|
2019-08-19 14:01:09 +02:00
|
|
|
|
2019-12-03 15:34:35 +01:00
|
|
|
- name: Assert that before dict is correctly generated
|
|
|
|
assert:
|
2019-08-19 14:01:09 +02:00
|
|
|
that:
|
2019-12-03 15:34:35 +01:00
|
|
|
- "{{ replaced['after'] == result['before'] }}"
|
2019-08-19 14:01:09 +02:00
|
|
|
|
|
|
|
always:
|
2019-12-03 15:34:35 +01:00
|
|
|
- include_tasks: _remove_config.yaml
|