e76630c4e4
* firewall_rules module added Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com> * state fact gathering code Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com> * facts and operation code added Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com> * unit tests added Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com> * sanity fixes Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com> * sanity fixes Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com> * sanity fixes Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com> * delete opr updated Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
---
|
|
- debug:
|
|
msg: "START vyos_firewall_rules parsed integration tests on connection={{ ansible_connection }}"
|
|
|
|
- include_tasks: _remove_config.yaml
|
|
|
|
- include_tasks: _populate.yaml
|
|
|
|
- block:
|
|
- name: Gather firewall_rules facts
|
|
vyos_facts:
|
|
gather_subset:
|
|
- default
|
|
gather_network_resources:
|
|
- firewall_rules
|
|
register: firewall_rules_facts
|
|
|
|
- name: Provide the running configuration for parsing (config to be parsed)
|
|
vyos_firewall_rules: &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_rules'] | symmetric_difference(result['parsed']) |length == 0 }}"
|
|
|
|
- name: Gather the existing running configuration (IDEMPOTENT)
|
|
vyos_firewall_rules: *parsed
|
|
register: result
|
|
|
|
- name: Assert that the previous task was idempotent
|
|
assert:
|
|
that:
|
|
- "result['changed'] == false"
|
|
|
|
always:
|
|
- include_tasks: _remove_config.yaml
|