Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible Galaxy: Keep clone of repositories #12353

Closed
muelli opened this issue Sep 14, 2015 · 10 comments · Fixed by #34642
Closed

Ansible Galaxy: Keep clone of repositories #12353

muelli opened this issue Sep 14, 2015 · 10 comments · Fixed by #34642
Labels
affects_2.1 This issue/PR affects Ansible v2.1 affects_2.3 This issue/PR affects Ansible v2.3 feature This issue/PR relates to a feature request. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@muelli
Copy link

muelli commented Sep 14, 2015

ISSUE TYPE

Feature Idea

COMPONENT NAME

core

ANSIBLE VERSION

2.1

CONFIGURATION
OS / ENVIRONMENT
SUMMARY

I'd appreciate if I could use ansible-galaxy to download the git repositories and keep them.
Right now ansible-galaxy does, e.g. git archive to get the contents and then discards the cloned git repository.
I'd like to keep the git repository, because I can then track changes more easily.

STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
@umeboshi2
Copy link

This might be best implemented as an option in the .yml file (e.g. develop: true) to clone and fetch/(merge/warn) on particular roles.

@umeboshi2
Copy link

It looks like there was an attempt to do this already. The PR is still pending, and seemed to be waiting for v2.

#6537

@bbaassssiiee
Copy link
Contributor

PR was closed, this feature has not been implemented.

@stonier
Copy link

stonier commented Aug 25, 2016

PR was closed, this feature has not been implemented.

Just to elaborate, this was not blocked or rejected, rather because of time/development/release issues. So working on a PR for this feature might still be worthwhile.

@ansibot ansibot added the affects_2.1 This issue/PR affects Ansible v2.1 label Sep 8, 2016
@ansibot ansibot added the affects_2.3 This issue/PR affects Ansible v2.3 label Dec 13, 2016
@ansibot ansibot added needs_info This issue requires further information. Please answer any outstanding questions. needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly. labels Apr 4, 2017
@ansibot
Copy link
Contributor

ansibot commented Apr 4, 2017

@muelli Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.

Here are the items we could not find in your description:

  • issue type
  • ansible version
  • component name

Please set the description of this issue with this template:
https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE.md

click here for bot help

@ansibot ansibot removed needs_info This issue requires further information. Please answer any outstanding questions. needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly. labels Apr 4, 2017
@ansibot ansibot added the support:core This issue/PR relates to code supported by the Ansible Engineering Team. label Jun 29, 2017
@calfonso calfonso added the waiting_on_contributor This would be accepted but there are no plans to actively work on it. label Oct 5, 2017
@thaumos
Copy link
Contributor

thaumos commented Oct 5, 2017

Just to be clear, is the ask to use a flag or option within ansible-galaxy to do a git clone as opposed to just downloading a tarball?

@ansibot ansibot removed the waiting_on_contributor This would be accepted but there are no plans to actively work on it. label Oct 5, 2017
@bbaassssiiee
Copy link
Contributor

This should be a flag for the ansible-galaxy command. Opposed to the view of @umeboshi2 I think it is best not to touch requirements.yml for this use-case. Only maintainers - tool smiths - will need this flag for integration testing and developing roles in separate repositories.

@spencertheduck
Copy link

I would have to disagree with @bbaassssiiee. while you are correct that this option would primarily be used by maintainers/tool smiths, Many of them will likely (and hopefully do) have automation in place as part of their validation flow. using tools like Ansible Tower/AWX which supports the requirements.yml convention, but doesn't allow you to modify the command that is executed to download the roles.

As a result, an option in the requirements.yml file would be the best choice to provide this feature.

Additionally, for public repos, it could aid in the collaborative development of roles, allowing for easier PR back to the master branch.

@leigh-j
Copy link
Contributor

leigh-j commented Jan 7, 2018

Agree with @bbaassssiiee Automation flows should exist, but I don't think developers should be coding on roles checked out by tower.

  • checkout all roles for a play to a dev host somewhere (ansible-galaxy install --clone)
  • update roles and check with some local testing
  • commit and push so tower/jenkins can do more rigorous testing.

@westurner
Copy link

westurner commented Dec 9, 2018

e224039 is helpful; thanks.

Maybe --clone-full and --clone-shallow ansible-galaxy switches would be helpful and useful?
I'd like to send PRs upstream; but in order to get e.g. a .git directory, I have to clone clone these urls as subrepos myself.

If I have this requirements.yml:

- src: linux-system-roles.network
  # https://github.com/linux-system-roles/network

When I do:

ansible-galaxy install -v -g --roles-path=./roles -r ./requirements.yml

ansible-galaxy downloads archives by default. But it could instead lookup the current repo url and do a full or a shallow clone; thus making it that much easier to send PRs to helpful role maintainers.

@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.1 This issue/PR affects Ansible v2.1 affects_2.3 This issue/PR affects Ansible v2.3 feature This issue/PR relates to a feature request. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.