Sorry, I wasn't as clear as I thought/wanted. ~/.ssh/config has a host
entry that sets up an alias from gh to
github.com.
After the playbook has run, I can go through the repositories that
were cloned as ssh://
g...@github.com/me/{{item}} and run "git remote
set-url ssh://gh/me/{{item}}" in each cloned repo to get things
configured the way I think I want. (I can unsuccessfully ssh and
pull/push without a hitch).
I thought this might be the key to my problem: I'm using a static
hosts file, with 2 groups. This host is the only one in both groups.
One group uses a sudoer (for configuring the big-picture OS parts),
the other a regular user that I want to use for day-to-day work. I'd
been using the playbooks to control which user does what, based on the
hosts associated with the playbook. For the first step this time
around, I had to comment out the non-privileged group to keep it from
overriding the user settings from the privileged group.
Running with -vvvv verified that ansible is connecting as the normal
user I want for this play (so that user's ~/.ssh/config should be in
effect...shouldn't it?)
Completely commenting the "privileged" group out of hosts didn't make
any difference that I can see.
Just for the sake of completeness, my hosts file looks like:
[sudoer]
#10.0.3.152 ansible_ssh_user=special ansible_ssh_pass=1234
ansible_sudo_pass=1234
[normal]
10.0.3.152 ansible_ssh_user=normal ansible_ssh_pass=5678
Just for grins, I added a play directly above the one for cloning the repos:
- name: Check ssh
remote_user: normal
command: ssh gh
It failed (as expected) with:
"stderr: PTY allocation request failed on channel 0
Hi me! You've successfully authenticated, but GitHub does not provide
shell access.
Connection to
github.com closed."
Which seems...really weird to me. It doesn't looks like the git module
is doing anything except building up a command line to basically do
this.
That led me to try some other command-based plays to clone repos
without looping:
- name: https clone
remote_user: normal
command: git clone
https://github.com/me/foo.git
* [worked]
- name: alt ssh clone
remote_user: normal
command: git clone ssh://
g...@github.com/me/baz.git
* [Permission denied (publickey).]
- name: check ssh
remote_user: normal
command: git clone ssh://gh/me/quux.git
* [worked]
Which leaves me more confused. How is the git module managing to clone
a url that my "alt ssh clone" refused?
On nights like this, when I've been staring at all the tickets about
github and ssh that might possibly be related, I wonder if the people
at ansible ever curse at the whim that led them to decide to support a
monstrosity like this.
Since, after all, I am *not* the target market.
Don't get me wrong. I appreciate how much easier you've made my life.
I'm just having flashbacks to all those bugs that refuse to admit that
I fixed them. And feeling bad because I don't know your code base well
enough yet to have fixed this myself.
Thank you,
James
> 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/onb0iDUB7ik/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
>
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzZC68jYTagSbHfgHD%2BPxEX6h-YrKxeX63q7keW%3Dyij5Q%40mail.gmail.com.