40 lines
1 KiB
YAML
40 lines
1 KiB
YAML
|
---
|
||
|
- debug:
|
||
|
msg: "START vyos_firewall_global parsed integration tests on connection={{ ansible_connection }}"
|
||
|
|
||
|
- include_tasks: _remove_config.yaml
|
||
|
|
||
|
- include_tasks: _populate.yaml
|
||
|
|
||
|
- block:
|
||
|
- name: Gather firewall_global facts
|
||
|
vyos_facts:
|
||
|
gather_subset:
|
||
|
- default
|
||
|
gather_network_resources:
|
||
|
- firewall_global
|
||
|
register: firewall_global_facts
|
||
|
|
||
|
- name: Provide the running configuration for parsing (config to be parsed)
|
||
|
vyos_firewall_global: &parsed
|
||
|
running_config:
|
||
|
"{{ lookup('file', '_parsed_config.cfg') }}"
|
||
|
state: parsed
|
||
|
register: result
|
||
|
|
||
|
- name: Assert that correct parsing done
|
||
|
assert:
|
||
|
that: "{{ ansible_facts['network_resources']['firewall_global'] == result['parsed'] }}"
|
||
|
|
||
|
- name: Gather the existing running configuration (IDEMPOTENT)
|
||
|
vyos_firewall_global: *parsed
|
||
|
register: result
|
||
|
|
||
|
- name: Assert that the previous task was idempotent
|
||
|
assert:
|
||
|
that:
|
||
|
- "result['changed'] == false"
|
||
|
|
||
|
always:
|
||
|
- include_tasks: _remove_config.yaml
|