-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Enforce passing a node name with validatorless bootstrapping #3325
Conversation
credentials When bootstrapping with chef-vault or with user credentials we create the node and client on the Chef Server before we bootstrap the node. As it is possible to specify a server address that is not the node name we need to enforce that the user pass a node name with -N.
I believe this solves: #3204 It is a little annoying that -N has become a required option. An alternative would be to grab the fqdn from the node and use that by default. |
@stevendanna I thought about doing that, but right now we do the node and client creation prior to actually bootstrapping the node. We don't know the FQDN for sure until we SSH into the node to run the bootstrap. If we wanted to keep the order of operations we'd probably end up doing two separate SSH commands: first to find the FQDN and second to actually bootstrap the node. If we think it's worth it I'd be happy to do that. |
And on windows you'd have to winrm into the node and do something. I thought about that, but its a bunch of work, and I'd rather do this, and then let a feature request drive doing the work to try to guess the node name by using the transport mechanism into the node. |
👍 |
we also still need this check anyway if the ssh fails to find a fqdn. i'm also worried about edge cases like 'localhost.localdomain'. |
👍 as this is definitely improvement. We should update any documentation and banners to indicate that the -N option isn't optional. |
Re making 2 SSH connections to get the hostname, I wouldn't be too concerned about that as we can just keep the SSH connection around; however, I'm not sure if that is possible in the windows case, which I hadn't considered. |
Yeah technically this doesn't support windows yet at all, I think knife-windows needs a template update |
knife-windows support for validatorless bootstrapping is being worked in in chef/knife-windows#224. |
Enforce passing a node name with validatorless bootstrapping
When bootstrapping with chef-vault or with user credentials we create
the node and client on the Chef Server before we bootstrap the node. As
it is possible to specify a server address that is not the node name we
need to enforce that the user pass a node name with -N.
At present if you omit the the node name you'll be prompted to delete
nonexistent clients and nodes.
cc @lamont-granquist
closes #3204