chef-boneyard / knife-rackspace

Chef knife plug-in for Rackspace
https://github.com/chef/knife-rackspace
Apache License 2.0
153 stars 114 forks source link

[KNIFE-366] Allow arbitrary bootstrap networks #57

Closed decklin closed 11 years ago

decklin commented 11 years ago

https://tickets.opscode.com/browse/KNIFE-366

I've created some custom networks in addition to the standard public/private nets. I'd like to be able to use these to bootstrap a node (I'm using OpenVPN and only routing to this new network I created, not to all of Rackspace's "private" net. The nodes I'm bootstrapping have IP addresses on "private" and my custom net).

In order to do this, I refactored some things so that instead of choosing one method to fetch the IP on "public" and another to fetch the IP on "private", there is just a single method that takes a network name. The new command line option (--bootstrap-network) subsumes the functionality of --private-network, but I left the latter in for backwards compatibility.

Let me know if this looks like a reasonable approach, if I need to file a ticket, or anything else you need.

krames commented 11 years ago

@decklin Could I get you to rename theip_addr to ip_address? Other than that it looks great to me!

Can I also get you to open up a ticket at tickets.opscode.com and reference this pull request? (It's part of OpsCode's release process)

Thanks!

decklin commented 11 years ago

Sure! created https://tickets.opscode.com/browse/KNIFE-366.

krames commented 11 years ago

@decklin Thanks for making that change for me.

Sorry I didn't bring this up earlier, but do you mind revising the README.rdoc to include information about this feature. After that, we are go for merge!

decklin commented 11 years ago

No problem. There wasn't anything about --private-network in README.rdoc, so I didn't mention it. I changed the option help text to "LABEL" to better match the "LABEL_OR_ID" used by --network, but, as those placeholders imply, you can only use a network label for this new option. Hope that's OK. The existing code to look up IDs for labels is kind of tangled up with the --network and --no-default-network options, and I have no need to specify a network by ID on the command line.

krames commented 11 years ago

@decklin LGTM!!! Thanks for the contribution! :shipit: