community.general icon indicating copy to clipboard operation
community.general copied to clipboard

ansible_galaxy_install has no update functionality that reports only updated collections as changed

Open bluikko opened this issue 1 year ago • 2 comments

Summary

In module ansible_galaxy_install there is no update functionality, there is only force: true option that will report changed to all collections even if they were not updated. This probably also applies to roles and not only collections.

There should be a way to update collections and report only updated collections as changed: true. This was easy to accomplish using ansible-galaxy command and a simple changed_when.

In essence the module ansible_galaxy_install is less usable than the ansible-galaxy command.

Issue Type

Feature Idea

Component Name

ansible_galaxy_install

Additional Information


Code of Conduct

  • [X] I agree to follow the Ansible Code of Conduct

bluikko avatar May 13 '24 06:05 bluikko

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar May 13 '24 07:05 ansibullbot

cc @russoz click here for bot help

ansibullbot avatar May 13 '24 07:05 ansibullbot

Hi @bluikko sorry for taking this long.

Thanks for your suggestion! You are correct, the module does not have that functionality. When this was first implemented we had to keep compatibility with Ansible 2.9, and the -U (upgrade) option only came out in ansible-core 2.11.

I will try and add the upgrade in the next couple of days, but while looking into the module I found some refactors to make, I need those to be merged before I make more changes. Watch this space.

russoz avatar May 25 '24 10:05 russoz

BTW, the ansible-galaxy role install command does not have the -U option, so no, it does not apply to roles as well.

russoz avatar May 26 '24 01:05 russoz

sorry for taking this long

Appreciate this even though I had absolutely zero expectations for any of this.

When this was first implemented we had to keep compatibility with Ansible 2.9, and the -U (upgrade) option only came out in ansible-core 2.11.

I see, that does make sense.

Thank you for your time!

bluikko avatar May 27 '24 04:05 bluikko