Can I override a collection's module using `library`?

Many modules in the google.cloud collection are in a sorry state. I would like to override some of them with local fixes. Before collections, I could specify library in my ansible.cfg and place a copy of the module in that library folder and ansible would use my fixed version of the module.

I tried renaming the module to add a google.cloud prefix. I also tried to place it in a google/cloud folder. But nothing seemed to work.

Is there a way to achieve the above? Should I open a feature request if it is not supported?

Sorry, no

collections are not designed to allow overrides, you would have to use ‘short names’ and insert your collection above it in priority:

collections:

  • google.fixed
  • google.cloud

But that also means you could have to change more code (mostly imports, depending on how they are written).

Something simlar can be done with library/shortname by using ansible.legacy collection.