---
- debug:
msg: "START ce_is_is_view import route policy presented integration tests on connection={{ ansible_connection }}"
- include_tasks: setup.yaml
- name: present the provided configuration with the exisiting running configuration
ce_is_is_view: &present
instance_id: 100
protocol: ospf
processid: 100
cost_type: external
import_cost: 10
import_tag: 10
import_route_policy: routepolicy_name
impotr_leveltype: level_1
inheritcost: true
permitibgp: true
tag: 100
register: result
- name: Assert the configuration is reflected on host
assert:
that:
- "result['changed'] == true"
- name: Get basic config by ce_netconf.
ce_netconf: &get_config
rpc: get
cfg_xml: "
100
afIpv4
0
"
register: result_xml
- name: present the provided configuration with the existing running configuration (IDEMPOTENT)
ce_is_is_view: *present
register: repeat
- name: Assert that the previous task was idempotent
assert:
that:
- "repeat.changed == false"
- "'ospf' in result_xml.end_state.result"
- "'100' in result_xml.end_state.result"
- "'external' in result_xml.end_state.result"
- "'10' in result_xml.end_state.result"
- "'10' in result_xml.end_state.result"
- "'level_1' in result_xml.end_state.result"
- "'routepolicy_name' in result_xml.end_state.result"
- "'level_1' in result_xml.end_state.result"
- "'true' in result_xml.end_state.result"
- "'true' in result_xml.end_state.result"
- name: present the provided configuration with the exisiting running configuration
ce_is_is_view: &absent
instance_id: 100
defaultmode: always
cost: 10
mode_tag: 10
level_type: level_1
avoid_learning: true
mode_routepolicyname: routepolicy_name
tag: 100
state: absent
register: result
- name: Assert the configuration is reflected on host
assert:
that:
- "result['changed'] == true"
- name: present the provided configuration with the existing running configuration (IDEMPOTENT)
ce_is_is_view: *absent
register: repeat
- name: Get basic config by ce_netconf.
ce_netconf: *get_config
register: result_xml
- name: Assert that the previous task was idempotent
assert:
that:
- "repeat.changed == false"
- "'ospf' not in result_xml.end_state.result"
- "'100' not in result_xml.end_state.result"
- "'external' not in result_xml.end_state.result"
- "'10' not in result_xml.end_state.result"
- "'10' not in result_xml.end_state.result"
- "'level_1' not in result_xml.end_state.result"
- "'routepolicy_name' not in result_xml.end_state.result"
- "'level_1' not in result_xml.end_state.result"
- "'true' not in result_xml.end_state.result"
- "'true' not in result_xml.end_state.result"
# after present, isis 100 should be deleted
- include_tasks: cleanup.yaml
- debug:
msg: "END ce_is_is_view import route policy resentd integration tests on connection={{ ansible_connection }}"