Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Rename deploy_to_cv role and module and release as cv_deploy #3785

Conversation

ClausHolbechArista
Copy link
Contributor

@ClausHolbechArista ClausHolbechArista commented Mar 27, 2024

Change Summary

Rename deploy_to_cv role and module.

arista.avd.deploy_to_cv module -> arista.avd.cv_workflow
arista.avd.deploy_to_cv role -> arista.avd.cv_deploy

How to test

Verified manually that old playbooks got deprecation warnings for role and module.
And for module:

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly.
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@ClausHolbechArista ClausHolbechArista requested review from a team as code owners March 27, 2024 10:59
@github-actions github-actions bot added type: documentation Improvements or additions to documentation type: code quality CI and development toolset state: Documentation role Updated labels Mar 27, 2024
@ClausHolbechArista ClausHolbechArista force-pushed the refactor/deploy_to_cv/rename_module_and_role branch from 0168581 to 572aae0 Compare March 27, 2024 11:00
@ClausHolbechArista ClausHolbechArista changed the title Refactor: Rename deploy_to_cv role and module Refactor: Rename deploy_to_cv role and module and release as cv_deploy Mar 27, 2024
- Creates, approves, starts Change Controls.
- Deploys special metadata for CV Pathfinder solution.

Devices will be identified using `serial_number`, `system_mac_address` or `hostname` (in prioritized order).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Devices will be identified using `serial_number`, `system_mac_address` or `hostname` (in prioritized order).
Devices will be identified using `serial_number`, `system_mac_address` or `hostname` (in precedence order).

Comment on lines +168 to +169
2. Push all configurations and tags.
3. Unassign tags
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this in the correct order ?

Copy link
Contributor

@noredistribution noredistribution left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where running the action module I do get

[DEPRECATION WARNING]: arista.avd.deploy_to_cv has been deprecated. The preview module 'arista.avd.deploy_to_cv' has been
released under the new name 'arista.avd.cv_workflow'. The module will be redirected automatically until AVD version 5.0.0
after which it will be removed. This feature will be removed from arista.avd in version 5.0.0. Deprecation warnings can be
disabled by setting deprecation_warnings=False in ansible.cfg.

when using the role I get it during the task

TASK [arista.avd.deploy_to_cv : Deprecation warning!] ************************************************************************
Wednesday 27 March 2024  14:07:10 +0000 (0:00:05.648)       0:00:26.069 *******
Wednesday 27 March 2024  14:07:10 +0000 (0:00:05.648)       0:00:26.069 *******
ok: [tp-avd-spine1 -> localhost] =>
  msg:
  - '!!! Deprecation Warning - The preview role ''arista.avd.deploy_to_cv'' has been released under the new name ''arista.avd.cv_deploy''.'
  - '!!! Deprecation Warning - The role will be redirected automatically until AVD version 5.0.0 after which it will be removed.'
  - '!!! Deprecation Warning - Importing role: arista.avd.cv_deploy ...'
  - 

but I also get a playbook failure when printing the old deploy_to_cv_results

fatal: [tp-avd-leaf6]: FAILED! =>
  msg: |-
    The task includes an option with an undefined variable. The error was: 'deploy_to_cv_results' is undefined. 'deploy_to_cv_results' is undefined

That's expected I assume?
This is my playbook task just in case

      tags: [deploy]
      ansible.builtin.import_role:
        name: arista.avd.deploy_to_cv
      vars:
        cv_server: www.cv-prod-uk-1.arista.io
        cv_token: "{{ lookup('file', 'token.tok')}}" 
        deploy_to_cv_accept_preview: true
        cv_skip_missing_devices: true
        cv_submit_workspace: true
        cv_run_change_control: true
        cv_configlet_name_template: "AVD-${hostname}"
        cv_register_detailed_results: true
        cv_change_control_description: "Tamas test Ansible AVD new deploy to cv role"
        cv_verify_certs: false
    - name: debug
      debug:
        msg: "{{deploy_to_cv_results}}"```

Copy link
Contributor

@gmuloc gmuloc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from a code point of view
Module redirection works well
I have not tested the role redirection nor the interaction with CV

@ClausHolbechArista
Copy link
Contributor Author

@noredistribution
but I also get a playbook failure when printing the old deploy_to_cv_results
Good catch! I renamed the registered variable, but I should handle that in the redirection. I will look into it.

@gmuloc
Copy link
Contributor

gmuloc commented Mar 27, 2024

where running the action module I do get

[DEPRECATION WARNING]: arista.avd.deploy_to_cv has been deprecated. The preview module 'arista.avd.deploy_to_cv' has been
released under the new name 'arista.avd.cv_workflow'. The module will be redirected automatically until AVD version 5.0.0
after which it will be removed. This feature will be removed from arista.avd in version 5.0.0. Deprecation warnings can be
disabled by setting deprecation_warnings=False in ansible.cfg.

when using the role I get it during the task

TASK [arista.avd.deploy_to_cv : Deprecation warning!] ************************************************************************
Wednesday 27 March 2024  14:07:10 +0000 (0:00:05.648)       0:00:26.069 *******
Wednesday 27 March 2024  14:07:10 +0000 (0:00:05.648)       0:00:26.069 *******
ok: [tp-avd-spine1 -> localhost] =>
  msg:
  - '!!! Deprecation Warning - The preview role ''arista.avd.deploy_to_cv'' has been released under the new name ''arista.avd.cv_deploy''.'
  - '!!! Deprecation Warning - The role will be redirected automatically until AVD version 5.0.0 after which it will be removed.'
  - '!!! Deprecation Warning - Importing role: arista.avd.cv_deploy ...'
  - 

but I also get a playbook failure when printing the old deploy_to_cv_results

fatal: [tp-avd-leaf6]: FAILED! =>
  msg: |-
    The task includes an option with an undefined variable. The error was: 'deploy_to_cv_results' is undefined. 'deploy_to_cv_results' is undefined

That's expected I assume? This is my playbook task just in case

      tags: [deploy]
      ansible.builtin.import_role:
        name: arista.avd.deploy_to_cv
      vars:
        cv_server: www.cv-prod-uk-1.arista.io
        cv_token: "{{ lookup('file', 'token.tok')}}" 
        deploy_to_cv_accept_preview: true
        cv_skip_missing_devices: true
        cv_submit_workspace: true
        cv_run_change_control: true
        cv_configlet_name_template: "AVD-${hostname}"
        cv_register_detailed_results: true
        cv_change_control_description: "Tamas test Ansible AVD new deploy to cv role"
        cv_verify_certs: false
    - name: debug
      debug:
        msg: "{{deploy_to_cv_results}}"```

This has changed indeed:

https://github.com/aristanetworks/avd/pull/3785/files#diff-8357ca6bfbfe632dd9f227192ffd549b40a0886a2e6a91e5a8a63ea47ed2cb82R56

Copy link
Contributor

@noredistribution noredistribution left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested both the old names and new names against 2024.1.0 and CVaaS and didn't break any of my playbooks

@gmuloc gmuloc added the one approval This PR has one approval and is only missing one more. label Mar 27, 2024
@gmuloc gmuloc added this to the v4.7.0 milestone Mar 27, 2024
@carlbuchmann carlbuchmann merged commit 95bb334 into aristanetworks:devel Mar 27, 2024
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
one approval This PR has one approval and is only missing one more. rn: Refactor state: Documentation role Updated type: code quality CI and development toolset type: documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants