This playbook will update ports on a Leaf interface profile but doesn’t work when attempting to update ports on a FEX connected to a leaf:
Here’s the playbook:
- name: "Bind Interface Selectors to Leaf Interface Policy Groups"
hosts: ACIHosts
gather_facts: no
vars_files:
- my_vault.yml
- My_Port_Profile_Kleaf221-FEX151-Copper-adds-test.yml
tasks:
- name: Association
cisco.aci.aci_access_port_to_interface_policy_leaf_profile:
host: apic1.company.com
username: "{{ ansible_ssh_user }}"
password: "{{ ansible_ssh_pass }}"
interface_profile: Kleaf221_FEX151_IntProf
#fex_profile: fexprof-Kleaf221_FEX151_IntProf <----------Ansible states this is an invalid parameter
access_port_selector: "{{ item.access_port_selector }}"
port_blk: "{{ item.port_blk }}"
leaf_port_blk_description: "{{ item.leaf_port_blk_description }}"
from_port: "{{ item.from_port }}"
to_port: "{{ item.to_port }}"
policy_group: "{{ item.policy_group }}"
#fex_id: 151 <--------------------Ansible states this is an invalid parameter
state: present
delegate_to: localhost
loop: "{{ MyPortProfile }}"
My_Port_Profile_Kleaf221-FEX151-Copper-adds-test.yml:
MyPortProfile:
- access_port_selector: eth151_1_2
port_blk: 2
leaf_port_blk_description: foo
from_port: 2
to_port: 2
policy_group: 10GigAuto_APG
Here’s the error I get:
failed: [bos-0k103-dc-apic1.mitre.org -> localhost] (item={'access_port_selector': 'eth151_1_2', 'port_blk': 2, 'leaf_port_blk_description': 'foo', 'from_port': 2, 'to_port': 2, 'policy_group': '10GigAuto_APG'}) => changed=false
ansible_loop_var: item
error:
code: '102'
text: 'configured object ((Dn0)) not found Dn0=uni/infra/accportprof-Kleaf221_FEX151_IntProf/hports-eth151_1_2-typ-range, '
item:
access_port_selector: eth151_1_2
from_port: 2
leaf_port_blk_description: foo
policy_group: 10GigAuto_APG
port_blk: 2
to_port: 2
msg: 'APIC Error 102: configured object ((Dn0)) not found Dn0=uni/infra/accportprof-Kleaf221_FEX151_IntProf/hports-eth151_1_2-typ-range, '