NixOS / nixops-hetzner

GNU Lesser General Public License v3.0
48 stars 14 forks source link

Hetzner deployment failing due to changed ssh port in my configuration #19

Open tokudan opened 7 years ago

tokudan commented 7 years ago

I set a non-standard SSH port for my systems through services.openssh.ports = [ 12345 ]; However during the first setup, the system still has the default port 22, which nixops only partially understands:

freya> waiting for rescue system...[down].............................................[up]
freya> building Nix bootstrap installer... done. (/nix/store/xpp9gpg907ggza6yi4q7k4019z4mq2sc-hetzner-nixops-installer/bin/hetzner-bootstrap)
freya> creating nixbld group in rescue system... 
freya> could not connect to ‘root@1.2.3.4’, retrying in 1 seconds...
freya> could not connect to ‘root@1.2.3.4’, retrying in 2 seconds...
freya> could not connect to ‘root@1.2.3.4’, retrying in 4 seconds...
freya> could not connect to ‘root@1.2.3.4’, retrying in 8 seconds...
error: unable to start SSH master connection to ‘root@1.2.3.4’

nixops is trying to connect to port 12345 instead of 22.

If I set deployment.targetPort = 22 then nixops is able to deploy, but hangs in an endless loop at the end during freya> waiting for the machine to finish rebooting...[down]... aborting and restarting the deploy results in

freya> copying closure...
ssh: connect to host 1.2.3.4 port 22: Connection timed out

Removing deployment.targetPort and restarting the deploy results in the same issue.

I would expect nixops to know the current ssh port of the machine.

P-E-Meunier commented 7 years ago

This is indeed a major problem when you want to install two different SSH servers (including one openssh), which is my case now… The Hetzner rescue system is accessed with port 22, deployments not using that port should be changed.