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): Configlet Validation support #615

Closed sugetha24 closed 1 year ago

sugetha24 commented 1 year ago

Change Summary

Adding support for configlet validation against devices

Related Issue(s)

Fixes #552

Component(s) name

arista.cvp.cv_validate_v3

Proposed changes

New module added: cv_validate_v3

Data model

    vars:
        CVP_DEVICES:
          - device_name: BAD032986065E8DC14CBB6472EC314A6
          search_type: serialNumber #[hostname | serialNumber | fqdn]
          local_configlets:
            configlet1: "..." 
            configlet2: "..." 
          cvp_configlet:
            - configlet3
            - configlet4
    arista.cvp.cv_validate_v3:
      device: "{{CVP_DEVICES}}"
      validate_mode: stop_on_error

How to test

Run the example playbooks in this PR

Molecule test

Update ansible_httpapi_host, ansible_host, ansible_user, ansible_password in ansible_collection/arista/cvp/examples/inventory.yml and run molecule converge -s cv_validate_v3 Log file: device_validate_config_LOG.log

End to End test

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.

chetryan commented 1 year ago

Do we support mixing of local and cvp configlets in a single validation attempt?

chetryan commented 1 year ago

@sugetha24 - I believe we're missing the documentation for this new module right?

chetryan commented 1 year ago

I think we should also be updating requirements.txt since it still says cvprac>=1.2.2 but actually we should be using cvprac>=1.3.1 to make sure the validation works correctly if CVP breaks the warnings into multiple lines ( resolved in this merge https://github.com/aristanetworks/cvprac/pull/248 )

sugetha24 commented 1 year ago

Do we support mixing of local and cvp configlets in a single validation attempt?

Yes. We do