add --not-reinstall-collections for quicker deployment#280
add --not-reinstall-collections for quicker deployment#280Yong HU (huyong1979) wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds an opt-out switch to speed up local deployments by avoiding a forced reinstall/rebuild of the local nsls2.ioc_deploy Ansible collection on each run, addressing the long ansible-galaxy collection install ... --force step reported in issue #275.
Changes:
- Introduces
--not-reinstall-collectionsto skip reinstalling/rebuilding the localnsls2.ioc_deploycollection. - Refactors the local collection install step into a helper (
install_local_collection) and makes it conditional on the new flag.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Yong HU (@huyong1979) I think adding the flag is fine - the reason we need to re-install the collection is if you make updates to the roles they will not be used unless the collection is installed. A lot of the time it takes is because you are likely running from runansible in your home directory which is a network file system, and the install makes lots of file operations. I suspect if you copy your project structure to |
An improvement for issue #275.
By default,
pixi run deployment -l ioc_full_host_name -c ../ioc_host_vars/acc_or_xf/ioc_full_host_name/ioc_instance_name.ymlstill re-installs the latest Galaxy collections by the commandansible-galaxy collection install ..., that takes more than 90 seconds, the majority of deployment time. For a quicker testing, one can use the option--not-reinstall-collectionsto skip the re-installation of the Galaxy collections if he/she is pretty sure the collections are already up-to-date.