ACI: Fixes to domain parameters dependencies (#36158)

We identified an incompleteness to parameter dependencies that affects
querying all domain-related objects.

This PR also includes:
- Improvements to integration tests
- Add missing vm_provider types
- Fix examples

This relates to #36131
This commit is contained in:
Dag Wieers 2018-02-14 13:51:38 +01:00 committed by GitHub
commit da5cf72236
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 213 additions and 110 deletions

View file

@ -65,6 +65,15 @@
aci_aep_to_domain: *binding_present
register: nm_add_binding
- name: Verify add_binding
assert:
that:
- cm_add_binding.changed == nm_add_binding.changed == true
- 'cm_add_binding.sent == nm_add_binding.sent == {"infraRsDomP": {"attributes": {"tDn": "uni/phys-phys_dom"}}}'
- 'cm_add_binding.proposed == nm_add_binding.proposed == {"infraRsDomP": {"attributes": {"tDn": "uni/phys-phys_dom"}}}'
- cm_add_binding.current == cm_add_binding.previous == nm_add_binding.previous == []
- 'nm_add_binding.current == [{"infraRsDomP": {"attributes": {"dn": "uni/infra/attentp-test_aep/rsdomP-[uni/phys-phys_dom]", "tDn": "uni/phys-phys_dom"}}}]'
- name: Add AEP to domain binding again (check_mode)
aci_aep_to_domain: *binding_present
check_mode: yes
@ -74,15 +83,10 @@
aci_aep_to_domain: *binding_present
register: nm_add_binding_again
- name: Verify add_binding
- name: Verify add_binding_again
assert:
that:
- cm_add_binding.changed == nm_add_binding.changed == true
- cm_add_binding_again.changed == nm_add_binding_again.changed == false
- 'cm_add_binding.sent == nm_add_binding.sent == {"infraRsDomP": {"attributes": {"tDn": "uni/phys-phys_dom"}}}'
- 'cm_add_binding.proposed == nm_add_binding.proposed == {"infraRsDomP": {"attributes": {"tDn": "uni/phys-phys_dom"}}}'
- cm_add_binding.current == cm_add_binding.previous == nm_add_binding.previous == []
- 'nm_add_binding.current == [{"infraRsDomP": {"attributes": {"dn": "uni/infra/attentp-test_aep/rsdomP-[uni/phys-phys_dom]", "tDn": "uni/phys-phys_dom"}}}]'
# QUERY ALL BINDINGS
@ -148,6 +152,13 @@
aci_aep_to_domain: *binding_absent
register: nm_remove_binding
- name: Verify remove_binding
assert:
that:
- cm_remove_binding.changed == nm_remove_binding.changed == true
- 'cm_remove_binding.current == cm_remove_binding.previous == nm_remove_binding.previous == [{"infraRsDomP": {"attributes": {"dn": "uni/infra/attentp-test_aep/rsdomP-[uni/phys-phys_dom]", "tDn": "uni/phys-phys_dom"}}}]'
- nm_remove_binding.current == []
- name: Remove AEP to domain binding again (check_mode)
aci_aep_to_domain: *binding_absent
check_mode: yes
@ -157,13 +168,10 @@
aci_aep_to_domain: *binding_absent
register: nm_remove_binding_again
- name: Verify remove_binding
- name: Verify remove_binding_again
assert:
that:
- cm_remove_binding.changed == nm_remove_binding.changed == true
- cm_remove_binding_again.changed == nm_remove_binding_again.changed == false
- 'cm_remove_binding.current == cm_remove_binding.previous == nm_remove_binding.previous == [{"infraRsDomP": {"attributes": {"dn": "uni/infra/attentp-test_aep/rsdomP-[uni/phys-phys_dom]", "tDn": "uni/phys-phys_dom"}}}]'
- nm_remove_binding.current == []
# QUERY NON-EXISTING BINDING

View file

@ -39,6 +39,15 @@
aci_domain: *domain_present
register: nm_add_domain
- name: Verify add_domain
assert:
that:
- cm_add_domain.changed == nm_add_domain.changed == true
- 'cm_add_domain.sent == nm_add_domain.sent == {"fcDomP": {"attributes": {"name": "fc_dom"}}}'
- 'cm_add_domain.proposed == nm_add_domain.proposed == {"fcDomP": {"attributes": {"name": "fc_dom"}}}'
- cm_add_domain.current == cm_add_domain.previous == nm_add_domain.previous == []
- 'nm_add_domain.current == [{"fcDomP": {"attributes": {"dn": "uni/fc-fc_dom", "name": "fc_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
- name: Add FC domain again (check_mode)
aci_domain: *domain_present
check_mode: yes
@ -48,15 +57,10 @@
aci_domain: *domain_present
register: nm_add_domain_again
- name: Verify add_domain
- name: Verify add_domain_again
assert:
that:
- cm_add_domain.changed == nm_add_domain.changed == true
- cm_add_domain_again.changed == nm_add_domain_again.changed == false
- 'cm_add_domain.sent == nm_add_domain.sent == {"fcDomP": {"attributes": {"name": "fc_dom"}}}'
- 'cm_add_domain.proposed == nm_add_domain.proposed == {"fcDomP": {"attributes": {"name": "fc_dom"}}}'
- cm_add_domain.current == cm_add_domain.previous == nm_add_domain.previous == []
- 'nm_add_domain.current == [{"fcDomP": {"attributes": {"dn": "uni/fc-fc_dom", "name": "fc_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
# QUERY ALL DOMAINS
@ -82,8 +86,8 @@
assert:
that:
- cm_query_all_domains.changed == nm_query_all_domains.changed == false
# NOTE: Order of domains is not stable between calls
#- cm_query_all_domains == nm_query_all_domains
- cm_query_all_domains == nm_query_all_domains
- nm_query_all_domains.current|length >= 1
# QUERY A DOMAIN
@ -119,6 +123,13 @@
aci_domain: *domain_absent
register: nm_remove_domain
- name: Verify remove_domain
assert:
that:
- cm_remove_domain.changed == nm_remove_domain.changed == true
- 'cm_remove_domain.current == cm_remove_domain.previous == nm_remove_domain.previous == [{"fcDomP": {"attributes": {"dn": "uni/fc-fc_dom", "name": "fc_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
- nm_remove_domain.current == []
- name: Remove FC domain again (check_mode)
aci_domain: *domain_absent
check_mode: yes
@ -128,23 +139,24 @@
aci_domain: *domain_absent
register: nm_remove_domain_again
- name: Verify remove_domain
- name: Verify remove_domain_again
assert:
that:
- cm_remove_domain.changed == nm_remove_domain.changed == true
- cm_remove_domain_again.changed == nm_remove_domain_again.changed == false
- 'cm_remove_domain.current == cm_remove_domain.previous == nm_remove_domain.previous == [{"fcDomP": {"attributes": {"dn": "uni/fc-fc_dom", "name": "fc_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
- nm_remove_domain.current == []
# QUERY NON-EXISTING DOMAIN
- name: Query non-existing FC domain (check_mode)
aci_domain: *domain_query
aci_domain:
<<: *domain_query
domain: fc_dom
check_mode: yes
register: cm_query_non_domain
- name: Query non-existing FC domain (normal mode)
aci_domain: *domain_query
aci_domain:
<<: *domain_query
domain: fc_dom
register: nm_query_non_domain
- name: Verify query_non_domain

View file

@ -39,6 +39,15 @@
aci_domain: *domain_present
register: nm_add_domain
- name: Verify add_domain
assert:
that:
- cm_add_domain.changed == nm_add_domain.changed == true
- 'cm_add_domain.sent == nm_add_domain.sent == {"l2extDomP": {"attributes": {"name": "l2_dom"}}}'
- 'cm_add_domain.proposed == nm_add_domain.proposed == {"l2extDomP": {"attributes": {"name": "l2_dom"}}}'
- cm_add_domain.current == cm_add_domain.previous == nm_add_domain.previous == []
- 'nm_add_domain.current == [{"l2extDomP": {"attributes": {"dn": "uni/l2dom-l2_dom", "name": "l2_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
- name: Add L2 domain again (check_mode)
aci_domain: *domain_present
check_mode: yes
@ -48,15 +57,10 @@
aci_domain: *domain_present
register: nm_add_domain_again
- name: Verify add_domain
- name: Verify add_domain_again
assert:
that:
- cm_add_domain.changed == nm_add_domain.changed == true
- cm_add_domain_again.changed == nm_add_domain_again.changed == false
- 'cm_add_domain.sent == nm_add_domain.sent == {"l2extDomP": {"attributes": {"name": "l2_dom"}}}'
- 'cm_add_domain.proposed == nm_add_domain.proposed == {"l2extDomP": {"attributes": {"name": "l2_dom"}}}'
- cm_add_domain.current == cm_add_domain.previous == nm_add_domain.previous == []
- 'nm_add_domain.current == [{"l2extDomP": {"attributes": {"dn": "uni/l2dom-l2_dom", "name": "l2_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
# QUERY ALL DOMAINS
@ -82,8 +86,8 @@
assert:
that:
- cm_query_all_domains.changed == nm_query_all_domains.changed == false
# NOTE: Order of domains is not stable between calls
#- cm_query_all_domains == nm_query_all_domains
- cm_query_all_domains == nm_query_all_domains
- nm_query_all_domains.current|length >= 1
# QUERY A DOMAIN
@ -119,6 +123,13 @@
aci_domain: *domain_absent
register: nm_remove_domain
- name: Verify remove_domain
assert:
that:
- cm_remove_domain.changed == nm_remove_domain.changed == true
- 'cm_remove_domain.current == cm_remove_domain.previous == nm_remove_domain.previous == [{"l2extDomP": {"attributes": {"dn": "uni/l2dom-l2_dom", "name": "l2_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
- nm_remove_domain.current == []
- name: Remove L2 domain again (check_mode)
aci_domain: *domain_absent
check_mode: yes
@ -128,23 +139,24 @@
aci_domain: *domain_absent
register: nm_remove_domain_again
- name: Verify remove_domain
- name: Verify remove_domain_again
assert:
that:
- cm_remove_domain.changed == nm_remove_domain.changed == true
- cm_remove_domain_again.changed == nm_remove_domain_again.changed == false
- 'cm_remove_domain.current == cm_remove_domain.previous == nm_remove_domain.previous == [{"l2extDomP": {"attributes": {"dn": "uni/l2dom-l2_dom", "name": "l2_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
- nm_remove_domain.current == []
# QUERY NON-EXISTING DOMAIN
- name: Query non-existing L2 domain (check_mode)
aci_domain: *domain_query
aci_domain:
<<: *domain_query
domain: l2_dom
check_mode: yes
register: cm_query_non_domain
- name: Query non-existing L2 domain (normal mode)
aci_domain: *domain_query
aci_domain:
<<: *domain_query
domain: l2_dom
register: nm_query_non_domain
- name: Verify query_non_domain

View file

@ -39,6 +39,15 @@
aci_domain: *domain_present
register: nm_add_domain
- name: Verify add_domain
assert:
that:
- cm_add_domain.changed == nm_add_domain.changed == true
- 'cm_add_domain.sent == nm_add_domain.sent == {"l3extDomP": {"attributes": {"name": "l3_dom"}}}'
- 'cm_add_domain.proposed == nm_add_domain.proposed == {"l3extDomP": {"attributes": {"name": "l3_dom"}}}'
- cm_add_domain.current == cm_add_domain.previous == nm_add_domain.previous == []
- 'nm_add_domain.current == [{"l3extDomP": {"attributes": {"dn": "uni/l3dom-l3_dom", "name": "l3_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
- name: Add L3 domain again (check_mode)
aci_domain: *domain_present
check_mode: yes
@ -48,15 +57,10 @@
aci_domain: *domain_present
register: nm_add_domain_again
- name: Verify add_domain
- name: Verify add_domain_again
assert:
that:
- cm_add_domain.changed == nm_add_domain.changed == true
- cm_add_domain_again.changed == nm_add_domain_again.changed == false
- 'cm_add_domain.sent == nm_add_domain.sent == {"l3extDomP": {"attributes": {"name": "l3_dom"}}}'
- 'cm_add_domain.proposed == nm_add_domain.proposed == {"l3extDomP": {"attributes": {"name": "l3_dom"}}}'
- cm_add_domain.current == cm_add_domain.previous == nm_add_domain.previous == []
- 'nm_add_domain.current == [{"l3extDomP": {"attributes": {"dn": "uni/l3dom-l3_dom", "name": "l3_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
# QUERY ALL DOMAINS
@ -82,8 +86,8 @@
assert:
that:
- cm_query_all_domains.changed == nm_query_all_domains.changed == false
# NOTE: Order of domains is not stable between calls
#- cm_query_all_domains == nm_query_all_domains
- cm_query_all_domains == nm_query_all_domains
- nm_query_all_domains.current|length >= 1
# QUERY A DOMAIN
@ -119,6 +123,13 @@
aci_domain: *domain_absent
register: nm_remove_domain
- name: Verify remove_domain
assert:
that:
- cm_remove_domain.changed == nm_remove_domain.changed == true
- 'cm_remove_domain.current == cm_remove_domain.previous == nm_remove_domain.previous == [{"l3extDomP": {"attributes": {"dn": "uni/l3dom-l3_dom", "name": "l3_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
- nm_remove_domain.current == []
- name: Remove L3 domain again (check_mode)
aci_domain: *domain_absent
check_mode: yes
@ -128,23 +139,24 @@
aci_domain: *domain_absent
register: nm_remove_domain_again
- name: Verify remove_domain
- name: Verify remove_domain_again
assert:
that:
- cm_remove_domain.changed == nm_remove_domain.changed == true
- cm_remove_domain_again.changed == nm_remove_domain_again.changed == false
- 'cm_remove_domain.current == cm_remove_domain.previous == nm_remove_domain.previous == [{"l3extDomP": {"attributes": {"dn": "uni/l3dom-l3_dom", "name": "l3_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
- nm_remove_domain.current == []
# QUERY NON-EXISTING DOMAIN
- name: Query non-existing L3 domain (check_mode)
aci_domain: *domain_query
aci_domain:
<<: *domain_query
domain: l3_dom
check_mode: yes
register: cm_query_non_domain
- name: Query non-existing L3 domain (normal mode)
aci_domain: *domain_query
aci_domain:
<<: *domain_query
domain: l3_dom
register: nm_query_non_domain
- name: Verify query_non_domain

View file

@ -39,6 +39,15 @@
aci_domain: *domain_present
register: nm_add_domain
- name: Verify add_domain
assert:
that:
- cm_add_domain.changed == nm_add_domain.changed == true
- 'cm_add_domain.sent == nm_add_domain.sent == {"physDomP": {"attributes": {"name": "phys_dom"}}}'
- 'cm_add_domain.proposed == nm_add_domain.proposed == {"physDomP": {"attributes": {"name": "phys_dom"}}}'
- cm_add_domain.current == cm_add_domain.previous == nm_add_domain.previous == []
- 'nm_add_domain.current == [{"physDomP": {"attributes": {"dn": "uni/phys-phys_dom", "name": "phys_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
- name: Add physical domain again (check_mode)
aci_domain: *domain_present
check_mode: yes
@ -48,15 +57,10 @@
aci_domain: *domain_present
register: nm_add_domain_again
- name: Verify add_domain
- name: Verify add_domain_again
assert:
that:
- cm_add_domain.changed == nm_add_domain.changed == true
- cm_add_domain_again.changed == nm_add_domain_again.changed == false
- 'cm_add_domain.sent == nm_add_domain.sent == {"physDomP": {"attributes": {"name": "phys_dom"}}}'
- 'cm_add_domain.proposed == nm_add_domain.proposed == {"physDomP": {"attributes": {"name": "phys_dom"}}}'
- cm_add_domain.current == cm_add_domain.previous == nm_add_domain.previous == []
- 'nm_add_domain.current == [{"physDomP": {"attributes": {"dn": "uni/phys-phys_dom", "name": "phys_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
# QUERY ALL DOMAINS
@ -82,8 +86,8 @@
assert:
that:
- cm_query_all_domains.changed == nm_query_all_domains.changed == false
# NOTE: Order of domains is not stable between calls
#- cm_query_all_domains == nm_query_all_domains
- cm_query_all_domains == nm_query_all_domains
- nm_query_all_domains.current|length >= 1
# QUERY A DOMAIN
@ -119,6 +123,13 @@
aci_domain: *domain_absent
register: nm_remove_domain
- name: Verify remove_domain
assert:
that:
- cm_remove_domain.changed == nm_remove_domain.changed == true
- 'cm_remove_domain.current == cm_remove_domain.previous == nm_remove_domain.previous == [{"physDomP": {"attributes": {"dn": "uni/phys-phys_dom", "name": "phys_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
- nm_remove_domain.current == []
- name: Remove physical domain again (check_mode)
aci_domain: *domain_absent
check_mode: yes
@ -128,23 +139,24 @@
aci_domain: *domain_absent
register: nm_remove_domain_again
- name: Verify remove_domain
- name: Verify remove_domain_again
assert:
that:
- cm_remove_domain.changed == nm_remove_domain.changed == true
- cm_remove_domain_again.changed == nm_remove_domain_again.changed == false
- 'cm_remove_domain.current == cm_remove_domain.previous == nm_remove_domain.previous == [{"physDomP": {"attributes": {"dn": "uni/phys-phys_dom", "name": "phys_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]'
- nm_remove_domain.current == []
# QUERY NON-EXISTING DOMAIN
- name: Query non-existing physical domain (check_mode)
aci_domain: *domain_query
aci_domain:
<<: *domain_query
domain: phys_dom
check_mode: yes
register: cm_query_non_domain
- name: Query non-existing physical domain (normal mode)
aci_domain: *domain_query
aci_domain:
<<: *domain_query
domain: phys_dom
register: nm_query_non_domain
- name: Verify query_non_domain

View file

@ -41,6 +41,16 @@
aci_domain: *domain_present
register: nm_add_domain
- name: Verify add_domain
assert:
that:
- cm_add_domain.changed == nm_add_domain.changed == true
- 'cm_add_domain.sent == nm_add_domain.sent == {"vmmDomP": {"attributes": {"name": "vmm_dom"}}}'
- 'cm_add_domain.proposed == nm_add_domain.proposed == {"vmmDomP": {"attributes": {"name": "vmm_dom"}}}'
- cm_add_domain.current == cm_add_domain.previous == nm_add_domain.previous == []
- nm_add_domain.current.0.vmmDomP.attributes.dn == 'uni/vmmp-VMware/dom-vmm_dom'
- nm_add_domain.current.0.vmmDomP.attributes.name == 'vmm_dom'
- name: Add VMM domain again (check_mode)
aci_domain: *domain_present
check_mode: yes
@ -50,16 +60,10 @@
aci_domain: *domain_present
register: nm_add_domain_again
- name: Verify add_domain
- name: Verify add_domain_again
assert:
that:
- cm_add_domain.changed == nm_add_domain.changed == true
- cm_add_domain_again.changed == nm_add_domain_again.changed == false
- 'cm_add_domain.sent == nm_add_domain.sent == {"vmmDomP": {"attributes": {"name": "vmm_dom"}}}'
- 'cm_add_domain.proposed == nm_add_domain.proposed == {"vmmDomP": {"attributes": {"name": "vmm_dom"}}}'
- cm_add_domain.current == cm_add_domain.previous == nm_add_domain.previous == []
- nm_add_domain.current.0.vmmDomP.attributes.dn == 'uni/vmmp-VMware/dom-vmm_dom'
- nm_add_domain.current.0.vmmDomP.attributes.name == 'vmm_dom'
# QUERY ALL DOMAINS
@ -86,8 +90,8 @@
assert:
that:
- cm_query_all_domains.changed == nm_query_all_domains.changed == false
# NOTE: Order of domains is not stable between calls
#- cm_query_all_domains == nm_query_all_domains
- cm_query_all_domains == nm_query_all_domains
- nm_query_all_domains.current|length >= 1
# QUERY A DOMAIN
@ -125,6 +129,15 @@
aci_domain: *domain_absent
register: nm_remove_domain
- name: Verify remove_domain
assert:
that:
- cm_remove_domain.changed == nm_remove_domain.changed == true
- cm_remove_domain.current == cm_remove_domain.previous == nm_remove_domain.previous
- nm_remove_domain.previous.0.vmmDomP.attributes.dn == 'uni/vmmp-VMware/dom-vmm_dom'
- nm_remove_domain.previous.0.vmmDomP.attributes.name == 'vmm_dom'
- nm_remove_domain.current == []
- name: Remove VMM domain again (check_mode)
aci_domain: *domain_absent
check_mode: yes
@ -134,25 +147,26 @@
aci_domain: *domain_absent
register: nm_remove_domain_again
- name: Verify remove_domain
- name: Verify remove_domain_again
assert:
that:
- cm_remove_domain.changed == nm_remove_domain.changed == true
- cm_remove_domain_again.changed == nm_remove_domain_again.changed == false
- cm_remove_domain.current == cm_remove_domain.previous == nm_remove_domain.previous
- nm_remove_domain.previous.0.vmmDomP.attributes.dn == 'uni/vmmp-VMware/dom-vmm_dom'
- nm_remove_domain.previous.0.vmmDomP.attributes.name == 'vmm_dom'
- nm_remove_domain.current == []
# QUERY NON-EXISTING DOMAIN
- name: Query non-existing VMM domain (check_mode)
aci_domain: *domain_query
aci_domain:
<<: *domain_query
domain: vmm_dom
vm_provider: vmware
check_mode: yes
register: cm_query_non_domain
- name: Query non-existing VMM domain (normal mode)
aci_domain: *domain_query
aci_domain:
<<: *domain_query
domain: vmm_dom
vm_provider: vmware
register: nm_query_non_domain
- name: Verify query_non_domain

View file

@ -68,6 +68,15 @@
aci_domain_to_vlan_pool: *binding_present
register: nm_add_binding
- name: Verify add_binding
assert:
that:
- cm_add_binding.changed == nm_add_binding.changed == true
- 'cm_add_binding.sent == nm_add_binding.sent == {"physDomP": {"attributes": {"name": "phys_dom"}, "children": [{"infraRsVlanNs": {"attributes": {"tDn": "uni/infra/vlanns-[test_pool]-dynamic"}}}]}}'
- 'cm_add_binding.proposed == nm_add_binding.proposed == {"physDomP": {"attributes": {"name": "phys_dom"}, "children": [{"infraRsVlanNs": {"attributes": {"tDn": "uni/infra/vlanns-[test_pool]-dynamic"}}}]}}'
- cm_add_binding.current == cm_add_binding.previous == nm_add_binding.previous == []
- 'nm_add_binding.current == [{"physDomP": {"attributes": {"dn": "uni/phys-phys_dom", "name": "phys_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}, "children": [{"infraRsVlanNs": {"attributes": {"tDn": "uni/infra/vlanns-[test_pool]-dynamic"}}}]}}]'
- name: Add domain to VLAN pool binding again (check_mode)
aci_domain_to_vlan_pool: *binding_present
check_mode: yes
@ -77,15 +86,10 @@
aci_domain_to_vlan_pool: *binding_present
register: nm_add_binding_again
- name: Verify add_binding
- name: Verify add_binding_again
assert:
that:
- cm_add_binding.changed == nm_add_binding.changed == true
- cm_add_binding_again.changed == nm_add_binding_again.changed == false
- 'cm_add_binding.sent == nm_add_binding.sent == {"physDomP": {"attributes": {"name": "phys_dom"}, "children": [{"infraRsVlanNs": {"attributes": {"tDn": "uni/infra/vlanns-[test_pool]-dynamic"}}}]}}'
- 'cm_add_binding.proposed == nm_add_binding.proposed == {"physDomP": {"attributes": {"name": "phys_dom"}, "children": [{"infraRsVlanNs": {"attributes": {"tDn": "uni/infra/vlanns-[test_pool]-dynamic"}}}]}}'
- cm_add_binding.current == cm_add_binding.previous == nm_add_binding.previous == []
- 'nm_add_binding.current == [{"physDomP": {"attributes": {"dn": "uni/phys-phys_dom", "name": "phys_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}, "children": [{"infraRsVlanNs": {"attributes": {"tDn": "uni/infra/vlanns-[test_pool]-dynamic"}}}]}}]'
# QUERY ALL BINDINGS
@ -99,7 +103,6 @@
use_proxy: '{{ aci_use_proxy | default(true) }}'
output_level: info
domain_type: phys
pool: test_pool
pool_allocation_mode: dynamic
state: query
check_mode: yes
@ -113,8 +116,8 @@
assert:
that:
- cm_query_all_bindings.changed == nm_query_all_bindings.changed == false
# NOTE: Order of bindings is not stable between calls
#- cm_query_all_bindings == nm_query_all_bindings
- cm_query_all_bindings == nm_query_all_bindings
- nm_query_all_bindings.current|length >= 1
# QUERY A BINDING
@ -131,6 +134,8 @@
aci_domain_to_vlan_pool:
<<: *binding_query
domain: phys_dom
pool: test_pool
pool_allocation_mode: dynamic
register: nm_query_binding
- name: Verify query_binding
@ -154,6 +159,13 @@
aci_domain_to_vlan_pool: *binding_absent
register: nm_remove_binding
- name: Verify remove_binding
assert:
that:
- cm_remove_binding.changed == nm_remove_binding.changed == true
- 'cm_remove_binding.current == cm_remove_binding.previous == nm_remove_binding.previous == [{"physDomP": {"attributes": {"dn": "uni/phys-phys_dom", "name": "phys_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}, "children": [{"infraRsVlanNs": {"attributes": {"tDn": "uni/infra/vlanns-[test_pool]-dynamic"}}}]}}]'
- nm_remove_binding.current == []
- name: Remove domain to VLAN pool binding again (check_mode)
aci_domain_to_vlan_pool: *binding_absent
check_mode: yes
@ -163,23 +175,28 @@
aci_domain_to_vlan_pool: *binding_absent
register: nm_remove_binding_again
- name: Verify remove_binding
- name: Verify remove_binding_again
assert:
that:
- cm_remove_binding.changed == nm_remove_binding.changed == true
- cm_remove_binding_again.changed == nm_remove_binding_again.changed == false
- 'cm_remove_binding.current == cm_remove_binding.previous == nm_remove_binding.previous == [{"physDomP": {"attributes": {"dn": "uni/phys-phys_dom", "name": "phys_dom", "nameAlias": "", "ownerKey": "", "ownerTag": ""}, "children": [{"infraRsVlanNs": {"attributes": {"tDn": "uni/infra/vlanns-[test_pool]-dynamic"}}}]}}]'
- nm_remove_binding.current == []
# QUERY NON-EXISTING BINDING
- name: Query non-existing domain to VLAN pool binding (check_mode)
aci_domain_to_vlan_pool: *binding_query
aci_domain_to_vlan_pool:
<<: *binding_query
domain: phys_dom
pool: test_pool
pool_allocation_mode: dynamic
check_mode: yes
register: cm_query_non_binding
- name: Query non-existing domain to VLAN pool binding (normal mode)
aci_domain_to_vlan_pool: *binding_query
aci_domain_to_vlan_pool:
<<: *binding_query
domain: phys_dom
pool: test_pool
pool_allocation_mode: dynamic
register: nm_query_non_binding
- name: Verify query_non_binding