Bootstrap client passing recipe attributes


#1

Hi,

I have a recipe that uses an attribute that will be different for
every node/client. Is there a way I can pass this attribute value on
the knife bootstrap command?

Thanks

Kelly


#2

How does the value get determined, Kelly?

Adam


Opscode, Inc.
Adam Jacob, Chief Customer Officer
T: (206) 619-7151 E: adam@opscode.com

On Jan 17, 2012, at 7:42 AM, Kelly Goedert wrote:

Hi,

I have a recipe that uses an attribute that will be different for
every node/client. Is there a way I can pass this attribute value on
the knife bootstrap command?

Thanks

Kelly


#3

Hi,

The value is a username in a network server. In some of my recipes I
have to connect to a cvs server I have and checkout some modules. The
attribute would be a username on the cvs server. I am creating recipes
to setup a developer machine, and one of the things I want to do is
checkout all cvs modules that a particular user will need. So, if I am
bootstrapping a chef client on a machine for Adam, and he works on
projects 1, 2, and 3 I would like to check them out on the process,
though I need Adam’s username on the cvs server.

And that is the attribute I want to pass.

On Tue, Jan 17, 2012 at 5:34 PM, Adam Jacob adam@opscode.com wrote:

How does the value get determined, Kelly?

Adam


Opscode, Inc.
Adam Jacob, Chief Customer Officer
T: (206) 619-7151 E: adam@opscode.com

On Jan 17, 2012, at 7:42 AM, Kelly Goedert wrote:

Hi,

I have a recipe that uses an attribute that will be different for
every node/client. Is there a way I can pass this attribute value on
the knife bootstrap command?

Thanks

Kelly


#4

I also would like to know how to pass attributes to a node in the
bootstrap phase. If I can figure out how to do this, I could pass the
final IP parameters and hostname via attributes.

This would be handy for a server that is freshly deployed coming up on a
DHCP assigned address and then prior to running the chef-client cookbook
recipe in the bootstrap command, the host’s name and network parameters
could be configured.

Thanks
Randy

-----Original Message-----
From: Kelly Goedert [mailto:kelly.goedert@gmail.com]
Sent: Wednesday, January 18, 2012 4:29 AM
To: chef@lists.opscode.com
Subject: [chef] Re: Re: bootstrap client passing recipe attributes

Hi,

The value is a username in a network server. In some of my recipes I
have to connect to a cvs server I have and checkout some modules. The
attribute would be a username on the cvs server. I am creating recipes
to setup a developer machine, and one of the things I want to do is
checkout all cvs modules that a particular user will need. So, if I am
bootstrapping a chef client on a machine for Adam, and he works on
projects 1, 2, and 3 I would like to check them out on the process,
though I need Adam’s username on the cvs server.

And that is the attribute I want to pass.

On Tue, Jan 17, 2012 at 5:34 PM, Adam Jacob adam@opscode.com wrote:

How does the value get determined, Kelly?

Adam


Opscode, Inc.
Adam Jacob, Chief Customer Officer
T: (206) 619-7151 E: adam@opscode.com

On Jan 17, 2012, at 7:42 AM, Kelly Goedert wrote:

Hi,

I have a recipe that uses an attribute that will be different for
every node/client. Is there a way I can pass this attribute value on
the knife bootstrap command?

Thanks

Kelly


#5

We run our bootstrap without knife so this may not pertain to you but we
accomplish this by passing global ruby variables to the recipes. So we
pass our bootstrap the parameters we want via command line switches and it
outputs a file on the server with the variables:

[ec2-user@ ~]$ cat /etc/chefvars.rb
$appkey = “chatproxy”
$deployid = “deployment-000010748”
$bucket = “western-development”

Then in a recipe you source this file and the variables are available:

require '/etc/chefvars.rb’
deployment_source = “#{$bucket}/deployments/#{$appkey}/#{$deployid}”

or you could use them to set attributes:

node.set[:deployment][:appkey] = “#{$appkey}”

Hope this helps.

MG

On Wed, Jan 18, 2012 at 8:51 AM, Van Fossan,Randy vanfossr@oclc.org wrote:

I also would like to know how to pass attributes to a node in the
bootstrap phase. If I can figure out how to do this, I could pass the
final IP parameters and hostname via attributes.

This would be handy for a server that is freshly deployed coming up on a
DHCP assigned address and then prior to running the chef-client cookbook
recipe in the bootstrap command, the host’s name and network parameters
could be configured.

Thanks
Randy

-----Original Message-----
From: Kelly Goedert [mailto:kelly.goedert@gmail.com]
Sent: Wednesday, January 18, 2012 4:29 AM
To: chef@lists.opscode.com
Subject: [chef] Re: Re: bootstrap client passing recipe attributes

Hi,

The value is a username in a network server. In some of my recipes I
have to connect to a cvs server I have and checkout some modules. The
attribute would be a username on the cvs server. I am creating recipes
to setup a developer machine, and one of the things I want to do is
checkout all cvs modules that a particular user will need. So, if I am
bootstrapping a chef client on a machine for Adam, and he works on
projects 1, 2, and 3 I would like to check them out on the process,
though I need Adam’s username on the cvs server.

And that is the attribute I want to pass.

On Tue, Jan 17, 2012 at 5:34 PM, Adam Jacob adam@opscode.com wrote:

How does the value get determined, Kelly?

Adam


Opscode, Inc.
Adam Jacob, Chief Customer Officer
T: (206) 619-7151 E: adam@opscode.com

On Jan 17, 2012, at 7:42 AM, Kelly Goedert wrote:

Hi,

I have a recipe that uses an attribute that will be different for
every node/client. Is there a way I can pass this attribute value on
the knife bootstrap command?

Thanks

Kelly