Thanks for your advice, Lee. I didn't know about project local .ssh/config files - excellent.
For anyone else reading this thread, it's documented here: https://github.com/capistrano/sshkit#tunneling-and-other-related-ssh-themes Regards, Steve On Friday, October 2, 2015 at 7:07:32 PM UTC+8, Lee Hambley wrote: > > I have a production.rb file with the above configuration. However, > capistrano will only deploy to the 2nd server (on port 12345). It seems > unable to detect that I have 2 separate servers which are distinguished by > port alone. > > We have had pull request left and right for changing the behaviour of > matching hosts for equality, including or excluding ports, usernames, and > other properties, it seems unfortunatley there's no happy medium. > > The canonical solution is to use a project local `./.ssh/config` to write > two host configs (SSHKit, and thus Capistrano will pick that file up and > apply it over anything it finds in your `~/.ssh/config`, and write two > hosts example_service_server_one example_service_server_two, and refer to > those in Capistrano, and add their properties in the project local ssh > config. > > Give it a try (it's documented in SSHKit, and Capistrano I believe) and > let me know how you get on. > > Lee Hambley > http://lee.hambley.name/ > +49 (0) 170 298 5667 > > On 2 October 2015 at 08:27, Steve Kenworthy <stev...@gmail.com > <javascript:>> wrote: > >> Versions: >> >> - Ruby 2.2.2 >> - Capistrano 3.4.0 >> - Rake 10.4.2 >> >> Platform: >> >> - Working on linux >> - Deploying to linux (on Azure - important, see later) >> >> Files: deploy/production.rb >> >> server 'example-service.cloudapp.net', user: 'deploy', roles: %w{web >> app db}, primary: true >> server 'example-service.cloudapp.net:12345', user: 'deploy', roles: >> %w{web app db} >> >> I have a production.rb file with the above configuration. However, >> capistrano will only deploy to the 2nd server (on port 12345). It seems >> unable to detect that I have 2 separate servers which are distinguished by >> port alone. >> >> Why would I want to do that anyway? I'm deploying to a service hosted on >> Azure. It's two linux servers load-balanced under a service called " >> example-service.cloudapp.net". I've opened firewall pinholes for ssh >> ports for both servers (22 and 12345) so I need to be able to distinguish >> between 2 separate servers solely by the fact they run under different >> ports. >> >> I'm guessing I'm doing it wrong and there might be a better way to define >> the servers. Would anyone be able to suggest an alternative? Thanks in >> advance. >> >> And yes, I can ssh into each box using the hostnames and ports above. >> This is more about capistrano being able to see there are two separate >> servers. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Capistrano" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to capistrano+...@googlegroups.com <javascript:>. >> To view this discussion on the web, visit >> https://groups.google.com/d/msgid/capistrano/dc5ea8ae-71f9-40f9-8aa5-032ff20b34a1%40googlegroups.com >> >> <https://groups.google.com/d/msgid/capistrano/dc5ea8ae-71f9-40f9-8aa5-032ff20b34a1%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Capistrano" group. To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+unsubscr...@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/732b96a5-d614-4049-9e8b-d35cffa1f895%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.