Unitech / pm2-deploy

Deploy part of PM2
http://pm2.keymetrics.io/docs/usage/deployment/
MIT License
178 stars 71 forks source link

forward-agent option don't work properly #110

Closed yevhene closed 6 years ago

yevhene commented 7 years ago

It is ignored

https://github.com/Unitech/pm2-deploy/blob/master/deploy#L99

quinn commented 7 years ago

Hi, does this work or not? afaik it does not work. the only mention of it anywhere is the above example and I haven't figured out how that shell script hooks into everything else yet in the code.

quinn commented 7 years ago

ok, i got this working by doing ssh_options: ['ForwardAgent=yes'] in my config. I'm not sure if the other way is deprecated, or doesn't work, or what. but this worked for me.

joeadcock commented 6 years ago

By itself ssh_options: ['ForwardAgent=yes'] doesn't work for me.

yevhene commented 6 years ago

@joeadcock You need to look at current source code, but year ago, as I can remember, it was ssh_options: ['-o ForwardAgent=yes']

joeadcock commented 6 years ago

@yevhene Thank for the quick reply!

It was because the repo host wasn't in the known hosts. I can confirm that ssh_options: ['ForwardAgent=yes'] does indeed work.

phra commented 6 years ago

i see that it's resolved. closing the issue.

yevhene commented 6 years ago

@phra pm2-deploy has dedicated forward_agent option. And it was broken. And issue was about forward_agent not ssh_options. But I don't know how it is now.

phra commented 6 years ago

@yevhene so sounds like a bug. should i reopen the issue? can you confirm that there is something broken?

madflow commented 5 years ago

Hello in 2019!

Like @yevhene said - there is a forward-agent option in: https://github.com/Unitech/pm2-deploy/blob/4e9655c042fa43ea82506cf5f4fad583a880568d/deploy#L104

I would expect something like this to work:

{
  // Agent forwarding
  'forward-agent': true,
}

This does work @phra and it is broken.

However this works:

{
  // Agent forwarding
  'forward-agent': 'Yeah well forward that agent',
}

My guess: the function config_get: https://github.com/Unitech/pm2-deploy/blob/4e9655c042fa43ea82506cf5f4fad583a880568d/deploy#L78

does not handle anything else but strings. And - yes ['ForwardAgent=yes'] does work.

leafac commented 4 years ago

I can confirm everything that @madflow said. Besides, the forward-agent configuration isn’t mentioned in the documentation.