You can use loop in your playbook
---
- name: ACI Link Level Management
hosts: APIC
connection: local
gather_facts: no
vars:
username: ansible
password: ansible123!
tasks:
- name: Create link level policies
cisco.aci.aci_interface_policy_link_level:
host: '{{ inventory_hostname }}'
user: '{{ username }}'
password: '{{ password }}'
validate_certs: false
link_level_policy: "{{ item.name }}"
auto_negotiation: "{{ item.auto }}"
speed: "{{ item.speed }}"
state: present
loop:
- { name: 'Speed_100M', auto: 'off', speed: '100M' }
- { name: 'Speed_1G', auto: 'off', speed: '1G' }
- { name: 'Speed_10G', auto: 'off', speed: '10G' }
- { name: 'Speed_100G', auto: 'off', speed: '100G' }
- { name: 'Speed_25G', auto: 'off', speed: '25G' }
- { name: 'Speed_40G', auto: 'off', speed: '40G' }
- { name: 'Speed_Auto', auto: 'on', speed: 'inherit' }
...
Source: https://www.mvankleij.nl/post/aci_and_ansible/