asa_config/ios_config: diff strict does not work with multiple parents (#45150)

* multiple parents issues in diff

* Integration tests for missing functionality

* add testcase for other platforms. vnxos does not support qos so need to find a command chain on v-nxos for multiple parets. junos uses on-device diff so should not need this.

* Fix for issue when any candidate parent did not meet the exact line in running-config

* DCI runs eos_config without become flag
This commit is contained in:
Deepak Agrawal 2018-09-12 07:50:24 +05:30 committed by GitHub
commit 81214409cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 278 additions and 0 deletions

View file

@ -0,0 +1,66 @@
---
- debug: msg="START cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}"
- name: setup
ios_config:
lines:
- class-map c1
- match precedence 7
- policy-map p1
- class c1
before: ['no policy-map p1', 'no class-map c1']
match: none
- name: configure sub level command using strict match
ios_config:
lines:
- set ip precedence 5
- police cir percent 10
parents: ['policy-map p1', 'class c1']
match: strict
register: result
- assert:
that:
- "result.changed == true"
- "'set ip precedence 5' in result.updates"
- "'police cir percent 10' in result.updates"
- name: change sub level command order and config with strict match
ios_config:
lines:
- police cir percent 10
- set ip precedence 5
parents: ['policy-map p1', 'class c1']
match: strict
register: result
- assert:
that:
- "result.changed == true"
- "'set ip precedence 5' in result.updates"
- "'police cir percent 10' in result.updates"
- name: Config sub level command with strict match (Idempotency)
ios_config:
lines:
#IOS does not change orded of class action if reconfigured
#so we have to use old order for Idempoteny
- set ip precedence 5
- police cir percent 10
parents: ['policy-map p1', 'class c1']
match: strict
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
ios_config:
lines:
- no policy-map p1
- no class-map c1
match: none
- debug: msg="END cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}"