Using Ansible with the aci_rest module, requires the authentication parameters (hostname, username, password, method, validate_certs) to be defined in every task e.g.
aci_rest:
hostname: "{{ inventory_hostname }}"
username: "{{ apic_username }}"
password: "{{ apic_password }}"
method: post
validate_certs: no
path: /api/node/mo/uni/controller/nodeidentpol.json
method: post
...etc
The YML Anchors, Aliases syntax works perfectly fine within one file.
- aci_rest:
<<: *aci_login
path: /api/node/mo/uni/controller/nodeidentpol.json
method: post
...etc
However not when variables and tasks are in different files using any of these functions:
vars_files:
include_tasks:
include_vars:
The full playbook has 70+ tasks with the authentication info repeated every time. I have not been able to find a way to not use repeat code. Is there a way to do this similar to yml alias?