aristanetworks / ansible-cvp

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

Fix: Allow tag assignment to serial numbers #581

Closed sugetha24 closed 1 year ago

sugetha24 commented 1 year ago

Change Summary

Assign tags to Serial Number of the device. Eg:

- name: Test cv_tag_v3
  hosts: CloudVision
  connection: local
  gather_facts: no
  vars:
    CVP_TAGS:
      - interface_tags:
          - tags:
              - name: intfT1
                value: intfV1
              - name: intfT2
                value: intfV2
            interface: Ethernet1/1
        device_id: JPE19181517
  tasks:
    - name: assign tags
      arista.cvp.cv_tag_v3:
        tags: "{{CVP_TAGS}}"
        mode: assign

Works the same way for device tags.

Related Issue(s)

Fixes #558

Component(s) name

arista.cvp.cv_tag_v3

Proposed changes

Added a new keyword device_id to capture serial number of the device

How to test

End to End test

Checklist

Repository Checklist

rwedmonds commented 1 year ago

PR Test Results

PR # Test Command Output Tests Successful?
581 assign.unassign-device-autocreate.yml ansible-playbook cv_tag_v3/assign.unassign-device-autocreate.yml -i inventory.yaml PLAY [Test cv_tag_v3] ****

TASK [assign/unassign non-existing device tags]****
changed: [CloudVision]

PLAY RECAP ****
CloudVision : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
:white_check_mark:
assign.unassign-device.yml ansible-playbook cv_tag_v3/assign.unassign-device.yml -i inventory.yaml PLAY [Test cv_tag_v3] ****

TASK [assign/unassign existing device tags] ****
changed: [CloudVision]

PLAY RECAP ****
CloudVision : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
:white_check_mark:
assign.unassign-interface-autocreate.yml ansible-playbook cv_tag_v3/assign.unassign-interface-autocreate.yml -i inventory.yaml PLAY [Test cv_tag_v3] ****

TASK [assign/unassign non-existing interface tags] ****
changed: [CloudVision]

PLAY RECAP ****
CloudVision : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
:white_check_mark:
assign.unassign-interface.yml ansible-playbook cv_tag_v3/assign.unassign-interface.yml -i inventory.yaml PLAY [Test cv_tag_v3] ****

TASK [assign/unassign existing interface tags] ****
changed: [CloudVision]

PLAY RECAP ****
CloudVision : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
:white_check_mark:
create.delete-device.yml ansible-playbook cv_tag_v3/create.delete-device.yml -i inventory.yaml PLAY [Test cv_tag_v3] ****

TASK [create/delete device tags] ****
changed: [CloudVision]

PLAY RECAP ****
CloudVision : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
:white_check_mark:
create.delete-interface.yml ansible-playbook cv_tag_v3/create.delete-interface.yml -i inventory.yaml PLAY [Test cv_tag_v3] ****

TASK [create/delete interface tags] ****
changed: [CloudVision]

PLAY RECAP ****
CloudVision : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
:white_check_mark: