ansible/test/integration/targets/junos_interfaces/tests/netconf/groups.yaml
Ganesh Nalawade 2a13ad7adf
Fix junos resource modules group based config and minor updates (#61224)
* Fix junos resource modules group based config and minor updates

Fixes https://github.com/ansible/ansible/issues/61183

*  Add support to get inherited configuration for resource
   modules to handle group based configuration
*  Add task input check for merged, replaced and overridden
   states in junos resource modules
*  Integration test for group based configuration

* Fix CI test failures

* Fix test failures
2019-08-27 11:06:06 +05:30

49 lines
1.5 KiB
YAML

---
- debug:
msg: "START junos_interfaces groups integration tests on connection={{ ansible_connection }}"
- include_tasks: _remove_config.yaml
- set_fact:
expected_group_output:
- name: ge-0/0/11
description: "within test group"
enable: true
- name: ge-0/0/12
description: "global interface config"
enable: true
- name: fxp0
enable: true
- name: "Teardown delete interface configuration"
junos_config: &delete_interface_config
lines:
- delete apply-groups test
- delete groups test interfaces ge-0/0/11
- delete interfaces ge-0/0/12
- block:
- name: "Setup interface configuration"
junos_config:
lines:
- set groups test interfaces ge-0/0/11 description "within test group"
- set apply-groups test
- set interfaces ge-0/0/12 description "global interface config"
- name: "get junos interfaces facts"
junos_facts:
gather_subset: min
gather_network_resources: interfaces
register: result
- name: Assert the configuration is reflected on host
assert:
that:
- "{{ expected_group_output | symmetric_difference(result['ansible_facts']['ansible_network_resources']['interfaces'])|length == 0 }}"
always:
- name: "Teardown delete interface configuration"
junos_config: *delete_interface_config
- debug:
msg: "END junos_interfaces merged integration tests on connection={{ ansible_connection }}"