Ansible Galaxy collections should support the “–keep-scm-meta” argument.

Summary

The –keep-scm-meta argument is useful during local development of collections as it permits bugfixes to be made to collection, and pushed easily.

Issue Type

Feature Idea

Component Name

ansible-galaxy

Additional Information

The collection git feature was implemented in #61680, but persisting the .git folder should be optional IMO, just as it is for roles currently.

Having the .git metadata is a crucial part of my current ansible-galaxy 2.9 role-based development process.
I plan to move towards collections in the future, but I believe this should be a feature handled by ansible-galaxy rather than an arbitrary bash script to keep dependencies in sync.

The code in question is available here:

def scm_archive_collection(src, name=None, version=‘HEAD’):
return scm_archive_resource(src, scm=‘git’, name=name, version=version, keep_scm_meta=False)

compared to role’s:

def scm_archive_role(src, scm=‘git’, name=None, version=‘HEAD’, keep_scm_meta=False):
return scm_archive_resource(src, scm=scm, name=name, version=version, keep_scm_meta=keep_scm_meta)

Hopefully this is something that can be implemented in the near future.

1 possible answer(s) on “Ansible Galaxy collections should support the “–keep-scm-meta” argument.

  1. We have discussed this and have decided this is not something we are going to pursue. We do not simply clone a git repo for collections, instead we clone it, build an artifact, and then install that artifact.

    Instead, you will want to just clone the repo into the correct path for ansible to see it, instead of relying on ansible-galaxy to perform the installation.

    If you have further questions please stop by IRC or the mailing list: