2019-08-27 07:36:06 +02:00
|
|
|
---
|
|
|
|
- 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"
|
2019-09-16 08:47:27 +02:00
|
|
|
enabled: true
|
2019-08-27 07:36:06 +02:00
|
|
|
- name: ge-0/0/12
|
|
|
|
description: "global interface config"
|
2019-09-16 08:47:27 +02:00
|
|
|
enabled: true
|
2019-08-27 07:36:06 +02:00
|
|
|
- name: fxp0
|
2019-09-16 08:47:27 +02:00
|
|
|
enabled: true
|
2019-08-27 07:36:06 +02:00
|
|
|
|
|
|
|
- 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 }}"
|