Predefining "knife bootstrap" parameters


#1

Dear list,

is there a way to configure some default arguments for the knife bootstrap
command?

Things like --environment or --distro, which are always/usually the same…

Thanks for your help!
Steffen


#2

I just found it easier to write some bash wrapper scripts in my chef-repo
directory.
On Dec 26, 2011 1:52 PM, st+opscode@st-g.de wrote:

Dear list,

is there a way to configure some default arguments for the knife bootstrap
command?

Things like --environment or --distro, which are always/usually the same…

Thanks for your help!
Steffen


#3

Thanks for your response, Sahil!
Will do so, too.

Steffen

On 26.12.2011, at 23:07, sahil.cooner@gmail.com wrote:

I just found it easier to write some bash wrapper scripts in my chef-repo directory.

On Dec 26, 2011 1:52 PM, st+opscode@st-g.de wrote:
Dear list,

is there a way to configure some default arguments for the knife bootstrap
command?

Things like --environment or --distro, which are always/usually the same…

Thanks for your help!
Steffen


#4

Yes, in your knife.rb:

knife[:distro] ||= "ubuntu11.04-gems"
knife[:environment] ||= “production”

On Tue, Dec 27, 2011 at 5:39 AM, Steffen Gebert st+opscode@st-g.de wrote:

Thanks for your response, Sahil!
Will do so, too.

Steffen

On 26.12.2011, at 23:07, sahil.cooner@gmail.com wrote:

I just found it easier to write some bash wrapper scripts in my
chef-repo directory.

On Dec 26, 2011 1:52 PM, st+opscode@st-g.de wrote:
Dear list,

is there a way to configure some default arguments for the knife bootstrap
command?

Things like --environment or --distro, which are always/usually the
same…

Thanks for your help!
Steffen


#5

Hi Jay,

Yes, in your knife.rb:
Ah, amazing!

Is there any documentation, what I can do there?
http://wiki.opscode.com/display/chef/Knife#Knife-ConfiguringYourSystemForKnife
lists only a small set of parameters - looks like I can do a lot more when modifying the knife array…

Steffen

On 28.12.2011, at 01:24, Jay Feldblum wrote:

Yes, in your knife.rb:

knife[:distro] ||= "ubuntu11.04-gems"
knife[:environment] ||= “production”

On Tue, Dec 27, 2011 at 5:39 AM, Steffen Gebert st+opscode@st-g.de wrote:
Thanks for your response, Sahil!
Will do so, too.

Steffen

On 26.12.2011, at 23:07, sahil.cooner@gmail.com wrote:

I just found it easier to write some bash wrapper scripts in my chef-repo directory.

On Dec 26, 2011 1:52 PM, st+opscode@st-g.de wrote:
Dear list,

is there a way to configure some default arguments for the knife bootstrap
command?

Things like --environment or --distro, which are always/usually the same…

Thanks for your help!
Steffen


#6

Hello,

On Wed, Dec 28, 2011 at 2:20 AM, Steffen Gebert st+opscode@st-g.de wrote:

Is there any documentation, what I can do there?

It’s a Ruby file and you can do pretty much anything…

http://wiki.opscode.com/display/chef/Knife#Knife-ConfiguringYourSystemForKnife
lists only a small set of parameters - looks like I can do a lot more when modifying the knife array…

That said, here’s a fully commented knife.rb with all the options
present (most commented). The options include all the ones that are in
the knife commands that come with Chef, as well as the Knife plugins
that Opscode maintains (like knife-ec2 or rackspace).

We’ll get this posted to the wiki and more easily found soon.

Opscode, Inc
Joshua Timberman, Technical Program Manager
IRC, Skype, Twitter, Github: jtimberman


#7

Cool, thanks Joshua!

On 28.12.2011, at 10:43, Joshua Timberman wrote:

Hello,

On Wed, Dec 28, 2011 at 2:20 AM, Steffen Gebert st+opscode@st-g.de wrote:

Is there any documentation, what I can do there?

It’s a Ruby file and you can do pretty much anything…

http://wiki.opscode.com/display/chef/Knife#Knife-ConfiguringYourSystemForKnife
lists only a small set of parameters - looks like I can do a lot more when modifying the knife array…

That said, here’s a fully commented knife.rb with all the options
present (most commented). The options include all the ones that are in
the knife commands that come with Chef, as well as the Knife plugins
that Opscode maintains (like knife-ec2 or rackspace).

https://gist.github.com/49b7b680c7b3d1d1be55

We’ll get this posted to the wiki and more easily found soon.

Opscode, Inc
Joshua Timberman, Technical Program Manager
IRC, Skype, Twitter, Github: jtimberman