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

Create/Deploy/Remove roles depend on Validate role #120

Closed marehler closed 2 months ago

marehler commented 3 months ago

The validate role can be executed individually, however the create, deploy, and remove roles depend on the validate role which creates the service model. Executing these roles individually fails:

TASK [cisco.nac_dc_vxlan.common : ansible.builtin.fail] *********************************************************************************************
fatal: [marehler_vnd2]: FAILED! => {"changed": false, "msg": "Service Model Not Defined.  Role cisco.nac_dc_vxlan.validate Must Be Called First"}

For a CI/CD workflow integration it might be desirable to execute all roles in different stages, i.e. execute one role per stage. Running the validate role in a "Validate" stage, and again in "Create" and "Deploy" stages for re-creating the service model would be duplicate effort and time.

mtarking commented 2 months ago

Indeed the validate role is a dependency as the rendered in-memory data model and subsequent massaging of the runtime model is rendered from the model validation. To make what you describe as achievable, the validate role has been added as an dependency to each role in the latest release (0.2.0) as part of PR #143. The validate role to-date only takes about ~1 sec to run.

I'm going to close this issue for now as this the current intended functionality. We can revisit if any complications are seen.

Tagging @mikewiebe for visibility and prior discussion.

marehler commented 2 months ago

Verified. Works fine, if you execute the create and/or deploy role only, the validate role is now included automatically.