-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Implement image bundle on device level (#505)
* Add image bundle info to cv_data * Update schema for bundles * Sketch in functions for applying image bundles * WIP * Implement apply or update image bundle to device * Cleaup whitespace * Implement bundle removal function * Rename for consistency * Fix API calls * Enhanced logging * Add results output * enhanced logging * More logging, fix serialNumber key * Fix syntax * Guard against empty results * More debug logging * Switch lookup to serial number * Fix key mappings * More logging * check deviceelement * issues with function * Try DeviceElement thing * Update DeviceElement for image_bundle * Fix consts * Add bundle attribute * Update assignment with more logging * More logging * Update schema * Tweak schema * adjust field * rollback changes * update schema * Handle device without assigned image bundle * Handle bundle name is None * More logging * Update info * Rename generic IMAGE_BUNDLE Cleanup trailing whitespace Explicitly set type as 'netelement' when assigining image * Implement bundle detach * Update documentation * Handle image bundle not existing * Fix whitespacing * Fix whitespacing Add manager for detach * Fix python linting for logging * Fix schema validation * adjust schema * adjust constant data * Update constants * bump indent to please PEP8 * Update description * Add image bundle info to cv_data * Update schema for bundles * Sketch in functions for applying image bundles * WIP * Implement apply or update image bundle to device * Cleaup whitespace * Implement bundle removal function * Rename for consistency * Fix API calls * Enhanced logging * Add results output * enhanced logging * More logging, fix serialNumber key * Fix syntax * Guard against empty results * More debug logging * Switch lookup to serial number * Fix key mappings * More logging * check deviceelement * issues with function * Try DeviceElement thing * Update DeviceElement for image_bundle * Fix consts * Add bundle attribute * Update assignment with more logging * More logging * Update schema * Tweak schema * adjust field * rollback changes * update schema * Handle device without assigned image bundle * Handle bundle name is None * More logging * Update info * Rename generic IMAGE_BUNDLE Cleanup trailing whitespace Explicitly set type as 'netelement' when assigining image * Implement bundle detach * Update documentation * Handle image bundle not existing * Fix whitespacing * Fix whitespacing Add manager for detach * Fix python linting for logging * Fix schema validation * adjust schema * adjust constant data * Update constants * bump indent to please PEP8 * Update description * Add example playbook * Update comments * Add empty line at EOF * added remove image playbook * Update to please the new markdown linter * Update to fix markdown linter * typo fix to make markdownlint happy * facts_tools: change IMAGE_BUNDLE to IMAGE_BUNDLE_NAME as it was changed in the generic API * Move example * Revert "Update to please the new markdown linter" This reverts commit 479a1bc. * Revert "Update to fix markdown linter" This reverts commit 000ba9e. Co-authored-by: Colin MacGiollaEain <colin@flat-planet.net> Co-authored-by: Sugetha Chandhrasekar <sugethakch@arista.com> Co-authored-by: Tamas Plugor <tamas@arista.com>
- Loading branch information
1 parent
8aa7410
commit f07ebf7
Showing
11 changed files
with
294 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
21 changes: 21 additions & 0 deletions
21
ansible_collections/arista/cvp/examples/cv_image_v3/assign-image-bundle-to-device.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
- name: Device Image Management in Cloudvision | ||
hosts: cv_server | ||
connection: local | ||
gather_facts: false | ||
collections: | ||
- arista.cvp | ||
vars: | ||
CVP_DEVICES: | ||
- serialNumber: JPE504a004ea054 | ||
parentContainerName: L2_Leaf | ||
configlets: | ||
- 'AVD_Ipmi3' | ||
imageBundle: leaf_bundle | ||
tasks: | ||
- name: "Configure devices on {{inventory_hostname}}" | ||
arista.cvp.cv_device_v3: | ||
devices: '{{CVP_DEVICES}}' | ||
state: present | ||
search_key: serialNumber | ||
apply_mode: strict |
20 changes: 20 additions & 0 deletions
20
ansible_collections/arista/cvp/examples/cv_image_v3/remove-image-bundle-to-device.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
- name: Device Image Management in Cloudvision | ||
hosts: cv_server | ||
connection: local | ||
gather_facts: false | ||
collections: | ||
- arista.cvp | ||
vars: | ||
CVP_DEVICES: | ||
- serialNumber: JPE504a004ea054 | ||
parentContainerName: L2_Leaf | ||
configlets: | ||
- 'AVD_Ipmi3' | ||
tasks: | ||
- name: "Configure devices on {{inventory_hostname}}" | ||
arista.cvp.cv_device_v3: | ||
devices: '{{CVP_DEVICES}}' | ||
state: present | ||
search_key: serialNumber | ||
apply_mode: strict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.