aristanetworks / ansible-cvp

Ansible modules for Arista CloudVision
http://cvp.avd.sh
Apache License 2.0
66 stars 61 forks source link

Feat(cv_device_v3): Add "inventory_mode" to allow ignoring missing devices #594

Closed ClausHolbechArista closed 1 year ago

ClausHolbechArista commented 1 year ago

Change Summary

Add "inventory_mode" to allow ignoring missing devices

Related Issue(s)

Fixes #579

Component(s) name

arista.cvp.cv_device_v3

Proposed changes

How to test

Tested manually.

With default inventory_mode: strict:

fatal: [CV_AVD_FABRIC]: FAILED! => {"changed": false, "msg": "Error - the following devices do not exist in CVP ['spine2'] but are defined in the playbook.                 \nMake sure that the devices are provisioned and defined with the full fqdn name                 (including the domain name) if needed."}

With inventory_mode: loose:

ok: [CV_AVD_FABRIC]

Checklist

User Checklist

Repository Checklist

github-actions[bot] commented 1 year ago

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] commented 1 year ago

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] commented 1 year ago

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] commented 1 year ago

Conflicts have been resolved. A maintainer will review the pull request shortly.

sugetha24 commented 1 year ago

@ClausHolbechArista Question:

  1. when we have inventory_mode: loose, there is no warning message in the return data structure that warns the user that one of the missing device was ignored. This might be useful to add to give user feedback about what passed and what didn't.
ClausHolbechArista commented 1 year ago

@ClausHolbechArista Question:

  1. when we have inventory_mode: loose, there is no warning message in the return data structure that warns the user that one of the missing device was ignored. This might be useful to add to give user feedback about what passed and what didn't.

I agree that we could give the user some information, and I will add that. But I don't think it should be a warning, since the user specifically configured the loose mode (they expect some devices to be missing). So I suggest to add it as info-level output.