CiscoDevNet/ansible-aci

aci_access_port_to_interface_policy_leaf_profile adding full tDn path in place of just group policy name.

kentk94 opened this issue ยท 2 comments

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

When creating an Access Port Selector that is a virtual port group, with interaface_type as a VPC, the policy_group appears to be putting the full tDn path in place of where just the name should be.

Please allow only the Name, after accbundle- to be placed into the policy_group field instead of a full tDn path.

  • xxxx

Affected Module Name(s):

aci_access_port_to_interface_policy_leaf_profile

APIC Version: 5.2.(4e) - on-prem

Collection versions

  • cisco.aci 2.3.0

Output/ Error message

The fault that gets generated calls out the following: Failed to form relation to MO uni/infra/funcprof/accbundle-IVPG_LAB_PD_Ansible_Test_1 of class infraAccBaseGrp.
*

Expected Behavior

just the following should have been placed in the Access Port Selector Policy Group Field:
IVPG_LAB_PD_Ansible_Test_1
*

Actual Behavior

The full tDN path, is being inserted into the field as: uni/infra/funcprof/accbundle-IVPG_LAB_PD_Ansible_Test_1
*

Playbook tasks to Reproduce

  • name: ACI - Create interface Virtual Selector
    hosts: apics
    vars_files: ~/vault/my_password_vault.yaml
    gather_facts: no
    connection: local

    tasks:

    • read_csv:
      path: ivsl_ports.csv
      delimiter: ','
      register: ivsl_port_list

    • name: Create a new interface virtual selector
      aci_access_port_to_interface_policy_leaf_profile:
      host: '{{ ansible_host }}'
      username: '{{ ansible_ssh_user }}'
      password: '{{ ansible_ssh_pass }}'
      output_level: debug
      leaf_interface_profile: '{{ item.intprofile }}'
      access_port_selector: '{{ item.portsel }}'
      description: '{{ item.portseldescr }}'
      policy_group_name: '{{ item.polgroup }}'
      interface_type: '{{ item.inttype }}'
      leaf_port_blk_description: '{{ item.portblkdescr }}'
      leaf_port_blk: '{{ item.portblk }}'
      from_port: '{{ item.fromport }}'
      to_port: '{{ item.toport }}'
      state: '{{ item.state }}'
      delegate_to: localhost
      register: create_result
      with_items: "{{ ivsl_port_list.list }}"

    • debug:
      msg:
      - "{{ create_result }}"

Important Factoids

I am importing this from a CSV that looks like this:
intprofile,portsel,portseldescr,polgroup,inttype,portblkdescr,portblk,fromport,toport,state
ILPR_PD_FL_NW01_LP,IVSL_LAB_PD_Ansible_Test_1,IVPG_LAB_PD_Ansible_Test_1,IVPG_LAB_PD_Ansible_Test_1,vpc,Ansible_Test,block26,26,26,present

A regular access port selector works fine as it does not need the policy_group_name to function.

References

  • #0000
    Policy_Group_Expected
    Policy_Group_Actual
    Policy_Group_Fault

Hi @kentk94 , it seems that APIC v5.2.x shows the DN when the object (Policy Group in this case) does not exist yet.

Did you create the "IVPG_LAB_PD_Ansible_Test_1" policy group already?

I did, but after looking closer there appears to be an error on my side. I ended up flipping the names between the VPC and the Port Selector. My bad.