Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting a winrm_user in knife.rb breaks linux bootstrapping in certain cases #459

Open
jasons42 opened this issue Jan 18, 2019 · 0 comments

Comments

@jasons42
Copy link

jasons42 commented Jan 18, 2019

Versions:

  • Version of knife-vsphere: 2.2.1
  • Version of chef: 14.7.17

Scenario:

This is a bit of an edge case but the cause/fix is likely not obvious from a user perspective.

When using the vm clone feature to bootstrap a linux box, it will attempt to SSH to the node with the win_rm user instead of the ssh_user if the following things are true:

  • There is an ssh_user set in knife.rb
  • There is a winrm_user set in knife.rb
  • The user passes the ssh_user flag with a value matching knife.rb (e.g., both "root")

Problem logic

if get_config(:ssh_user).eql?(options[:ssh_user][:default]) &&
    !get_config(:winrm_user).eql?(options[:winrm_user][:default])
    config[:ssh_user] = get_config(:winrm_user)
end

Passing --bootstrap-protocol ssh does not resolve this issue.

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

No branches or pull requests

1 participant