Closed captncraig closed 6 years ago
The other context I hope to deploy from is teamcity. In that environment, the key will be pre-loaded into ssh-agent by the build runner, but the username will still come from the local ~/.ssh/config I think.
I have a hunch that the username is always read from cluster.yml
even if ssh config defines one. And if it doesn't, it will use the default, which is "ubuntu". Not optimal, will be fixed.
The Pharos::Configuration::Host
's user
defaults to ubuntu
... that's a bug at this point: https://github.com/kontena/pharos-cluster/blob/5c90b3ae3f6b8837f6de6b289df1dd85ff27e5a2/lib/pharos/configuration/host.rb#L17
Making progress... after testing with 1.2.0 rc1, it gets the right username, but still doesn't use the IdentityFile from the config. Prompts for password still.
The fix didn't remove the default value for ssh_key_path
.
attribute :ssh_key_path, Pharos::Types::Strict::String.default('~/.ssh/id_rsa')
I have set
~/.ssh/config
up with the following:and my pharos config contains hosts like:
Pharos does not seem to get the user/key from the ssh config:
ubuntu@devkubecl-node01.mydomain's password:
Fully specifying username and ssh key still works. Just specifying user or key alone are also not sufficient.