Skip to content
This repository has been archived by the owner on Dec 12, 2019. It is now read-only.

SSH forwarding not working for custom role on VMware #336

Open
richierampage opened this issue Feb 11, 2016 · 3 comments
Open

SSH forwarding not working for custom role on VMware #336

richierampage opened this issue Feb 11, 2016 · 3 comments

Comments

@richierampage
Copy link

Hi,

I can't get ssh forwarding to work for a task within my custom role.

- command: git push -u origin --all
args:
chdir: /var/www/site/docroot
removes: "/var/www/site/docroot/.git"
register: dir
- debug: var=dir.stdout_lines

The push requires my host key which is forwarded. Works fine manually from the guest and other Ansible commands that don't require key work fine too.

I suspect there is some ssh config/variable somewhere within vlad that is missing from the custom role or it's a vmware issue. Hoping there's an easy fix.

Any help much appreciated!

Thanks

Rich

@richierampage richierampage changed the title SSH forwarding for custom role on VMware SSH forwarding not working for custom role on VMware Feb 11, 2016
@dixhuit
Copy link
Contributor

dixhuit commented Feb 15, 2016

Hi Rich. One way to test if your key has been successfully forwarded is to run the following command from the guest:

ssh-add -L

If successfully forwarded it should return the contents of the forwarded public key file. Hopefully that can help narrow down what's going on with your custom playbook.

@richierampage
Copy link
Author

Cheers Dan,

My issue was that I was trying to do too much with the Vlad custom role with other hosts. I was trying to ssh to a server via vlad, so vagrant key was failing even if ssh passthrough is working.

I have now split out my server/deployment stuff into a separate playbook which works fine.

Running ssh-add would be good to add as a local task option, I have to do it everytime I reboot my mac else passthrough doesn't work. I will do a pr if I do it.

@dixhuit
Copy link
Contributor

dixhuit commented Feb 15, 2016

Running ssh-add would be good to add as a local task option

We already do:

https://github.com/hashbangcode/vlad/search?utf8=%E2%9C%93&q=ssh-add

Are you setting the use_host_id variable in your Vlad settings?

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

No branches or pull requests

2 participants