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

Enforce passing a node name with validatorless bootstrapping #3325

Merged
merged 1 commit into from
May 20, 2015

Conversation

ryancragun
Copy link
Contributor

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

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.
@stevendanna
Copy link
Contributor

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.

@ryancragun
Copy link
Contributor Author

@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.

@lamont-granquist
Copy link
Contributor

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.

@lamont-granquist
Copy link
Contributor

👍

@lamont-granquist
Copy link
Contributor

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'.

@stevendanna
Copy link
Contributor

👍 as this is definitely improvement. We should update any documentation and banners to indicate that the -N option isn't optional.

@stevendanna
Copy link
Contributor

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.

@lamont-granquist
Copy link
Contributor

Yeah technically this doesn't support windows yet at all, I think knife-windows needs a template update

@btm
Copy link
Contributor

btm commented May 18, 2015

knife-windows support for validatorless bootstrapping is being worked in in chef/knife-windows#224.

thommay added a commit that referenced this pull request May 20, 2015
Enforce passing a node name with validatorless bootstrapping
@thommay thommay merged commit 7f0de95 into master May 20, 2015
@thommay thommay deleted the ryan/validatorless_bootstrap branch May 20, 2015 10:57
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

knife bootstrap fails if -N option is not passed
7 participants