netascode / ansible-dc-vxlan

Ansible Collection for configuring a VXLAN Fabric using Direct to Controller (DTC) or Direct To Device (DTD) workflows.
https://galaxy.ansible.com/ui/repo/published/cisco/nac_dc_vxlan/
MIT License
6 stars 6 forks source link

Get Credentials and Remove Role Fixes #125

Closed mikewiebe closed 2 months ago

mikewiebe commented 2 months ago

Summary of Changes:

IMPORTANT Once this change goes in we need to revert the following changes again but only AFTER we publish this collection to Galaxy.

https://github.com/netascode/ansible-dc-vxlan-example/commit/2e1a2917b0baab7421f53051f0504b000f70b30d

Additional Details:

Here are the test cases that I executed to verify the credential lookup logic

Using the following information from connection.yaml

---
# Connection Parameters for 'ndfc' inventory group
#
# Controller Credentials
ansible_connection: ansible.netcommon.httpapi
ansible_httpapi_port: 443
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
ansible_network_os: cisco.dcnm.dcnm
# NDFC API Credentials
ansible_user: "{{ lookup('env', 'ND_USERNAME') }}"
ansible_password: "{{ lookup('env', 'ND_PASSWORD') }}"

# Credentials for devices in Inventory lookup using ENV vars
ndfc_switch_username: "{{ lookup('env', 'NDFC_SW_USERNAME') }}"
ndfc_switch_password: "{{ lookup('env', 'NDFC_SW_PASSWORD') }}"

# Hard Coded Credentials
ndfc_switch_username: "admin"
ndfc_switch_password: "password"

Resolves #111