Ansible Collection install, and detached head when using git tag

102 views Asked by At

When managing my ansible collection, I see significant advantages of using git tags for managing controlled releases of versions for improvements, fixes and so on, and 'rolling back'.

However when installing my collection:

ansible-galaxy collection install -r requirements.yaml

I get informational messages regarding detached head. Whilst this makes sense to me given the nature of git tags and how I understand it works, what is the generally accepted method to suppress this message within ansible, without globally changing git configuration? Is there any way I can declare this option within my requirements.yaml file for instance - or should I look to modify my ansible.cfg?

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

My requirements.yaml file:

---  
collections:
  - name: [email protected]:some_org/some_collection.git      
    type: git
    version: v1.0.0
0

There are 0 answers