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

Cannot specify an Identity File (Deploy Key) to use with private git repositories. #337

Open
peterchoo opened this issue Feb 15, 2018 · 3 comments

Comments

@peterchoo
Copy link

We have some roles which cannot be made public, but are required in multiple projects. These repositories are accessed via Deploy Keys.

I would like to be able to specify an SSH key in the roles file for ansible-galaxy to use per role (if required), similar to how I can in the git module with the key_file argument.

@chouseknecht
Copy link
Contributor

@peterchoo

My first thought was to use the environment variable GIT_SSH, but you wouldn't be able to set that at a per-role level when installing via requirements.yml.

A work around would be to use a playbook to run the install. The playbook task would use command to run ansible-galaxy, combined with with_items to loop over a data structure containing the role name and the SSH key path.

@chouseknecht chouseknecht added this to the Backlog milestone Feb 15, 2018
@peterchoo
Copy link
Author

@chouseknecht Thanks for the quick response, and the possibility of using a a playbook.

It's a work around that we are currently using in one place, however it's unsatisfactory because it isn't something that we expect to do, and is added complexity. We are also using public roles available from Galaxy, and so having two places to install roles from is not the end of the world, but it is undesired.

@rob0r
Copy link

rob0r commented Jul 25, 2019

Would be amazing if the Ansible Galaxy requirements.yml worked similar to the git module as already mentioned.

- git:
    repo: 'ssh://[email protected]/path/to/repo.git'
    dest: /srv/checkout
    key_file: path_to_key

$workplace has a private set of Ansible repo's and at the moment, doing a hack to pull these repos down is messy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants