Skip to content

Commit

Permalink
[minor_change] Add support for simple statements in useg attributes w…
Browse files Browse the repository at this point in the history
…ith the aci_epg_useg_attribute_simple_statement module
  • Loading branch information
Christian-Kolrep authored and lhercot committed Feb 29, 2024
1 parent 8b04016 commit c629012
Show file tree
Hide file tree
Showing 10 changed files with 559 additions and 1,150 deletions.
27 changes: 15 additions & 12 deletions plugins/module_utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,21 @@
)

USEG_ATTRIBUTE_MAPPING = dict(
vm_name=dict(attr_type="vm-name", attr_class="fvVmAttr"),
vm_guest=dict(attr_type="guest-os", attr_class="fvVmAttr"),
vm_host=dict(attr_type="hv", attr_class="fvVmAttr"),
vm_id=dict(attr_type="vm", attr_class="fvVmAttr"),
vmm_domain=dict(attr_type="domain", attr_class="fvVmAttr"),
vm_datacenter=dict(attr_type="rootContName", attr_class="fvVmAttr"),
vm_custom_attr=dict(attr_type="custom-label", attr_class="fvVmAttr"),
vm_tag=dict(attr_type="tag", attr_class="fvVmAttr"),
vm_nic=dict(attr_type="vnic", attr_class="fvVmAttr"),
ip=dict(attr_type="ip", attr_class="fvIpAttr"),
mac=dict(attr_type="mac", attr_class="fvMacAttr"),
ip=dict(attribute_type="ip", attribute_class="fvIpAttr", rn_format="ipattr-{0}"),
mac=dict(attribute_type="mac", attribute_class="fvMacAttr", rn_format="macattr-{0}"),
dns=dict(attribute_type="dns", attribute_class="fvDnsAttr", rn_format="dnsattr-{0}"),
ad_group=dict(attribute_type="ad", attribute_class="fvIdGroupAttr", rn_format="idgattr-[{0}]"),
vm_custom_attr=dict(attribute_type="custom-label", attribute_class="fvVmAttr", rn_format="vmattr-{0}"),
vm_vmm_domain=dict(attribute_type="domain", attribute_class="fvVmAttr", rn_format="vmattr-{0}"),
vm_operating_system=dict(attribute_type="guest-os", attribute_class="fvVmAttr", rn_format="vmattr-{0}"),
vm_hypervisor_id=dict(attribute_type="hv", attribute_class="fvVmAttr", rn_format="vmattr-{0}"),
vm_datacenter=dict(attribute_type="rootContName", attribute_class="fvVmAttr", rn_format="vmattr-{0}"),
vm_id=dict(attribute_type="vm", attribute_class="fvVmAttr", rn_format="vmattr-{0}"),
vm_name=dict(attribute_type="vm-name", attribute_class="fvVmAttr", rn_format="vmattr-{0}"),
vm_folder=dict(attribute_type="vm-folder", attribute_class="fvVmAttr", rn_format="vmattr-{0}"),
vm_folder_path=dict(attribute_type="vmfolder-path", attribute_class="fvVmAttr", rn_format="vmattr-{0}"),
vm_vnic=dict(attribute_type="vnic", attribute_class="fvVmAttr", rn_format="vmattr-{0}"),
vm_tag=dict(attribute_type="tag", attribute_class="fvVmAttr", rn_format="vmattr-{0}"),
)

# useg attribute operator mapping
OPERATOR_MAPPING = dict(equals="equals", contains="contains", starts_with="startsWith", ends_with="endsWith")
22 changes: 1 addition & 21 deletions plugins/modules/aci_epg.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,26 +138,6 @@
state: present
delegate_to: localhost
- Add two new EPG
cisco.aci.aci_epg:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
ap: ticketing
epg: "{{ item.epg }}"
description: Ticketing EPG
bd: "{{ item.bd }}"
priority: unspecified
intra_epg_isolation: unenforced
state: present
delegate_to: localhost
with_items:
- epg: web
bd: web_bd
- epg: database
bd: database_bd
- name: Add a new uSeg EPG
cisco.aci.aci_epg:
host: apic
Expand All @@ -174,7 +154,7 @@
state: present
delegate_to: localhost
- name: Add a uSeg EPG with criterion match and precedence
- name: Add a uSeg EPG with block statement match and precedence
cisco.aci.aci_epg:
host: apic
username: admin
Expand Down
Loading

0 comments on commit c629012

Please sign in to comment.