Skip to content
New issue

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

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

Already on GitHub? # to your account

Issues in integrating ansible with teleport #1353

Closed
ksorathiya opened this issue Sep 30, 2017 · 6 comments
Closed

Issues in integrating ansible with teleport #1353

ksorathiya opened this issue Sep 30, 2017 · 6 comments

Comments

@ksorathiya
Copy link

ksorathiya commented Sep 30, 2017

https://gravitational.com/teleport/docs/2.3/admin-guide/#integrating-with-ansible

As teleport's documentation states, I went through each and every step carefully but every time it was a complete failure.

I am not able to connect to my teleport nodes using the following command
ssh <teleport-user>@<teleport-node>.<teleport-proxy>

I am very much stuck at this, can anyone please help?

@kontsevoy
Copy link
Contributor

@ksorathiya I am not following... the docs never say to do this: ssh <teleport-user>@<teleport-node>.<teleport-proxy>.

In fact, nothing special is required for Ansible... maybe we should remove that section completely, not to confuse people?

  1. Execute tsh login
  2. Check if the regular tsh ssh host work.
  3. Create a symlink tsh to ssh so when Ansible calls ssh user@host it will resolve to tsh binary.

That's all you really need.

If step 2. is not preferred, configure the regular ssh to work by updating your .ssh/config as shown in the docs.

@ksorathiya
Copy link
Author

I tried creating the symlink ssh -> tsh, for normal usage it worked,
but to connect to the remote host ansible fires this command

/usr/bin/ssh -vvv -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=kartik -o ConnectTimeout=10 <teleport-hostname> '/bin/sh -c '"'"'( umask 77 && mkdir -p "echo /tmp/ansible-tmp-1506965039.42-255698492516050" && echo ansible-tmp-1506965039.42-255698492516050="echo /tmp/ansible-tmp-1506965039.42-255698492516050" ) && sleep 0'"'"''

and as obvious it throws this error
(1, '', "unknown short flag '-v'\n")

so the symlink thing won't help me integrating ansible with teleport

@ksorathiya
Copy link
Author

The steps in this https://gravitational.com/teleport/docs/2.3/user-manual/#using-openssh-client appears promising but at last, I am getting this error

I directly ran this command
ssh -i ~/.tsh/keys/<teleport-proxy>/<teleport-user> -p 3023 <teleport-user>@<teleport-proxy> -s proxy:<teleport-node>.<teleport-proxy>:3022

Permission denied (publickey).

One more thing
Host *.lab.example.com
Port 3022
IdentityFile ~/.tsh/keys/lab.example.com/joe
ProxyCommand ssh -i ~/.tsh/keys/lab.example.com/joe -p 3023 %r@lab.example.com -s proxy:%h:%p

as stated above,
there was no such file ~/.tsh/keys/<teleport-proxy>/<teleport-username>
ther were three files
.key .cert .pub

@kontsevoy
Copy link
Contributor

you need the .key file.

@kontsevoy
Copy link
Contributor

@ksorathiya also I think you're using old Teleport version. tsh version should say 2.3 (because you're following 2.3 docs)

@kontsevoy
Copy link
Contributor

@ksorathiya I am closing. happy to jump on a call if you still having issues: ev@gravitational.com

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

No branches or pull requests

2 participants