Generally this was written for deployment purposes.
Just curious on your use case:
(A) So in your organization the repo is locked down?
(B) Or you are automating developer machine setups?
I can see both being useful, but I'm guessing A, right?
(If you are pulling off a repo that is non-secured and it is just for
deployment purposes, I'd probably just clone read only)
I'm going to add some cool tricks to pass environment variables to
/everything/ really soon, and this may be exactly what you want.
Can you hold off a few days maybe? It would allow for GIT_SSH
trivially, without modifying the module.
I ran into the same problem (needing to clone a git repo that is only privately accessible via a key). I'm wondering if the feature for passing an environment variable is implemented in the most current version of ansible yet?
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/Tumb7svuGwg/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
- name: Upload the SSH keycopy: src=id_rsa_deployment dest=/tmp/id_rsa_deployment mode=600- name: Configure SSH scripttemplate: src=git_ssh.j2 dest=/tmp/git_ssh.sh mode=700- name: Clone the git repo using GIT_SSHgit: repo=ssh://g...@bitbucket.org/username/someprivaterepo.git dest=/home/username/project depth=1environment:GIT_SSH: /tmp/git_ssh.sh
#!/bin/shexec /usr/bin/ssh -o StrictHostKeyChecking=no -i /tmp/id_rsa_deployment "$@"
- name: Upload the SSH key
copy: src=path/to/git-identity dest=/path/to/git-identity mode=600
- name: Clone the git repo using GIT_SSH
git: repo=ssh://g...@bitbucket.org/username/someprivaterepo.git dest=/path/to/project git_key=/path/to/git-identityIn any case it's definitely a common pattern and it would be helpful to add it to the docs.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
only. I know that the right answer in this case is a passphrase-less
key with read-only access to the repository, but my curiosity can't help
but wonder if there's a way to have a setup with a key passphrase.
There is a slight hitch that I haven't bothered to overcome yet: the github remote key has to be accepted first (ie. test the github access from the account doing the deploy so it shows up in known_hosts).
Does anyone else have a different way of doing this they may also want to share?
Maybe this can help (didn't test it yet):