Include Gloabl Variables


#1

HI,

I know that there are many ways to include global attributes into a new cookbook. But is there a way to create a global_attributes file (there are lots of information and dependencies in there) which will be included into a new cookbook.

I think the sentences makes no sense at all (if I read it a second time) but I will explain it:

Attribute file (stands alone with no recipe and so on)
(code, ok not the real code :slight_smile: )
If platform = debian -> x = 23 else 24

And this information should be inserted in a file which I created with the cookbook “Whats_the_answer”
(coe, not the real one)
Create file to /tmp/blubb with information “x”

The Problem is that I only want to use 1 attributes file where all the information is stored.

I tested it with the “include recipes”-method bnut this doesn’t work for attributes, too.

Kind regards


#2

Data bags can be thought of as read only global variables that can be
accessed across the cookbook boundary. They are probably the droid
you’re looking for.

http://wiki.opscode.com/display/chef/Data+Bags

On Tue, Mar 22, 2011 at 11:54 AM, WEINHAPL Andreas
andreas.weinhapl@thalesgroup.com wrote:

HI,

I know that there are many ways to include global attributes into a new
cookbook. But is there a way to create a global_attributes file (there are
lots of information and dependencies in there) which will be included into
a new cookbook.

I think the sentences makes no sense at all (if I read it a second time) but
I will explain it:

Attribute file (stands alone with no recipe and so on)

(code, ok not the real code J )

If platform = debian -> x = 23 else 24

And this information should be inserted in a file which I created with the
cookbook “Whats_the_answer”

(coe, not the real one)

Create file to /tmp/blubb with information “x”

The Problem is that I only want to use 1 attributes file where all the
information is stored.

I tested it with the “include recipes”-method bnut this doesn’t work for
attributes, too.

Kind regards


#3

Mhm, that’s the hint what I needed :slight_smile: Many thanks, I forgot this point.

-----Original Message-----
From: Sean OMeara [mailto:someara@gmail.com]
Sent: Dienstag, 22. März 2011 17:00
To: chef@lists.opscode.com
Subject: [chef] Re: Include Gloabl Variables

Data bags can be thought of as read only global variables that can be
accessed across the cookbook boundary. They are probably the droid
you’re looking for.

http://wiki.opscode.com/display/chef/Data+Bags

On Tue, Mar 22, 2011 at 11:54 AM, WEINHAPL Andreas
andreas.weinhapl@thalesgroup.com wrote:

HI,

I know that there are many ways to include global attributes into a new
cookbook. But is there a way to create a global_attributes file (there are
lots of information and dependencies in there) which will be included into
a new cookbook.

I think the sentences makes no sense at all (if I read it a second time) but
I will explain it:

Attribute file (stands alone with no recipe and so on)

(code, ok not the real code J )

If platform = debian -> x = 23 else 24

And this information should be inserted in a file which I created with the
cookbook “Whats_the_answer”

(coe, not the real one)

Create file to /tmp/blubb with information “x”

The Problem is that I only want to use 1 attributes file where all the
information is stored.

I tested it with the “include recipes”-method bnut this doesn’t work for
attributes, too.

Kind regards