Upgrading from chef 11 to 12

Hey guys,

I’m looking to upgrade my chef server to chef 12, and I want to get opinions on the transition. Am I going to have any issues upgrading?

Are there any compatability issues with cookbooks written with chef 11 in mind?

On Thursday, February 5, 2015 at 6:08 PM, Taylor Price wrote:

Hey guys,

I'm looking to upgrade my chef server to chef 12, and I want to get opinions on the transition. Am I going to have any issues upgrading?

Are there any compatability issues with cookbooks written with chef 11 in mind?
FYI, you don’t have to upgrade your clients and server in lockstep. 11.x clients work with 12.x server and vice versa.

There are a handful of minor compatibility breakages between Chef Client 11.x and Chef Client 12.x. One of the most significant is that SSL certificate verification is enabled by default. So before you upgrade clients, fix the ssl warnings from chef-client 11 (I think these were introduced in chef-client 11.8 or so) and try running with ssl_verify_mode :verify_peer in your client.rb. If you can’t possibly get that to work, you can opt out in client 12.x by setting ssl_verify_mode :verify_none (but you should really try to avoid that). Most of the other significant changes are documented here: Chef Infra Client Release Notes and here: https://github.com/chef/chef-rfc/blob/master/rfc015-chef-12.md

On the server side, you might be interested in doing a restore to a fresh Chef 12 installation for testing, which is discussed in this thread: chef - [chef] Re: Re: migrating from chef 11 to chef 12 server

HTH,

--
Daniel DeLeo

On Thu, Feb 05, 2015 at 06:52:52PM -0800, Daniel DeLeo wrote:

On Thursday, February 5, 2015 at 6:08 PM, Taylor Price wrote:

Hey guys,

I'm looking to upgrade my chef server to chef 12, and I want to get opinions on the transition. Am I going to have any issues upgrading?

Are there any compatability issues with cookbooks written with chef 11 in mind?
FYI, you don’t have to upgrade your clients and server in lockstep. 11.x clients work with 12.x server and vice versa.

That's not... ENTIRELY true. You need a config change on EC11 in order for
it to accept Chef 12 clients... It's not clear of the OP was using OSC11 or
EC11.

The config change is:

lb['chef_max_version'] = 12

--
Phil Dibowitz phil@ipom.com
Open Source software and tech docs Insanity Palace of Metallica
http://www.phildev.net/ http://www.ipom.com/

"Be who you are and say what you feel, because those who mind don't matter
and those who matter don't mind."

  • Dr. Seuss

I'm sorry, I am using Open Source Chef 11. Looking at the milestone for
12.1.0, there seem to be a decent number of open bugs, but nothing that
looks breaking for me. I will give this a go soon!

On Thu, Feb 5, 2015 at 8:24 PM, Phil Dibowitz phil@ipom.com wrote:

On Thu, Feb 05, 2015 at 06:52:52PM -0800, Daniel DeLeo wrote:

On Thursday, February 5, 2015 at 6:08 PM, Taylor Price wrote:

Hey guys,

I'm looking to upgrade my chef server to chef 12, and I want to get
opinions on the transition. Am I going to have any issues upgrading?

Are there any compatability issues with cookbooks written with chef 11
in mind?
FYI, you don’t have to upgrade your clients and server in lockstep. 11.x
clients work with 12.x server and vice versa.

That's not... ENTIRELY true. You need a config change on EC11 in order for
it to accept Chef 12 clients... It's not clear of the OP was using OSC11 or
EC11.

The config change is:

lb['chef_max_version'] = 12

--
Phil Dibowitz phil@ipom.com
Open Source software and tech docs Insanity Palace of Metallica
http://www.phildev.net/ http://www.ipom.com/

"Be who you are and say what you feel, because those who mind don't matter
and those who matter don't mind."

  • Dr. Seuss

Hi
When i do
knife search node name:devwsgw20150130113529 -a tomcat.user1 items found
devwsgw20150130113529: tomcat.user: tomcat
I see there is an attribute called tomcat.user
In recipe I am using,
tcuser=node.attribute[:tomcat][:user]log “tc user is #{tcuser}”

When I run the chef-client on the above node, i see the following line printed
Compiling Cookbooks…Converging 14 resourcesRecipe: update::deploy * log[tc user is ] action write
Why can knife search the attribute and the recipe cannot?
Please provide pointers/suggestions.
Regards
mg

tcuser=node.attribute[:tomcat][:user]
log "tc user is #{tcuser}"

this is wrong, you want something like:

tcuser = node['tomcat']['user']

in your Recipe. I don't know that node.attribute does what you mean.

cheers,

--aj

On Fri, Feb 6, 2015 at 5:42 PM, M G meher03@hotmail.com wrote:

Hi

When i do

knife search node name:devwsgw20150130113529 -a tomcat.user
1 items found

devwsgw20150130113529:
tomcat.user: tomcat

I see there is an attribute called tomcat.user

In recipe I am using,

tcuser=node.attribute[:tomcat][:user]
log "tc user is #{tcuser}"

When I run the chef-client on the above node, i see the following line
printed

Compiling Cookbooks...
Converging 14 resources
Recipe: update::deploy

  • log[tc user is ] action write

Why can knife search the attribute and the recipe cannot?

Please provide pointers/suggestions.

Regards

mg

Hi AJ
OK. I ran the recipe using your suggestion and still the variable tcuser comes up empty when running on the node.
knife search node name:devwsgw20150130113529 -a tomcat1 items found
devwsgw20150130113529: tomcat: base: /opt/apache-tomcat-7.0.54 user: tomcat
As you can see the attribute tomcat has two child attributes base and user with values in them.
In the recipe, I have the following code:
tc=node.attribute[:tomcat][:base]log "tc base is #{tc}"tcuser=node[‘tomcat’][‘user’]log "tc user is #{tcuser}"
And while running it I get

  • log[tc base is /opt/apache-tomcat-7.0.54] action write
  • log[tc user is ] action write
    So you see using the colon notation I am able to get the value of tomcat’s child attribute “base” but using the colon notation and your suggested notation I get nothing. This is strange behavior that I have not encountered .
    Any suggestions/pointers ?
    Regards
    mg
    Date: Fri, 6 Feb 2015 17:45:11 +1300
    From: aj@junglistheavy.industries
    To: chef@lists.opscode.com
    Subject: [chef] Re: Knife search shows attributes but cannot find same attribute in recipe
log "tc user is #{tcuser}"```
this is wrong, you want something like:
```tcuser = node['tomcat']['user']```
in your Recipe. I don't know that `node.attribute` does what you mean.
cheers,
--aj
On Fri, Feb 6, 2015 at 5:42 PM, M G <meher03@hotmail.com> wrote:



Hi
When i do 
knife search node name:devwsgw20150130113529 -a tomcat.user1 items found
devwsgw20150130113529:  tomcat.user: tomcat
I see there is an attribute called tomcat.user
In recipe I am using,
tcuser=node.attribute[:tomcat][:user]log "tc user is #{tcuser}"

When I run the chef-client on the above node, i see the following line printed
Compiling Cookbooks...Converging 14 resourcesRecipe: update::deploy  * log[tc user is ] action write
Why can knife search the attribute and the recipe cannot?
Please provide pointers/suggestions.
Regards
mg

try node.debug_value(:tc, :user) in a chef-shell with the attributes
loaded or in your Recipe DSL [0]; you should be able to determine the
source of your attribute woes. Given that you have not shared with us your
attribute structure (cookbooks, roles, environments, json attributes, ohai
custom plugins) without additional diagnostics, my recommendations are
limited.

Please provide a full debug log if possible, too! -ldebug or similar.

cheers,

--aj

http://jtimberman.housepub.org/blog/2014/09/02/chef-node-dot-debug-value/

On Fri, Feb 6, 2015 at 8:47 PM, M G meher03@hotmail.com wrote:

Hi AJ

OK. I ran the recipe using your suggestion and still the variable tcuser
comes up empty when running on the node.

knife search node name:devwsgw20150130113529 -a tomcat
1 items found

devwsgw20150130113529:
tomcat:
base: /opt/apache-tomcat-7.0.54
user: tomcat

As you can see the attribute tomcat has two child attributes base and user
with values in them.

In the recipe, I have the following code:

tc=node.attribute[:tomcat][:base]
log "tc base is #{tc}"
tcuser=node['tomcat']['user']
log "tc user is #{tcuser}"

And while running it I get

  • log[tc base is /opt/apache-tomcat-7.0.54] action write

  • log[tc user is ] action write

So you see using the colon notation I am able to get the value of tomcat's
child attribute "base"
but using the colon notation and your suggested notation I get nothing.
This is strange behavior that I have not encountered .

Any suggestions/pointers ?

Regards

mg


Date: Fri, 6 Feb 2015 17:45:11 +1300
From: aj@junglistheavy.industries
To: chef@lists.opscode.com
Subject: [chef] Re: Knife search shows attributes but cannot find same
attribute in recipe

tcuser=node.attribute[:tomcat][:user]
log "tc user is #{tcuser}"

this is wrong, you want something like:

tcuser = node['tomcat']['user']

in your Recipe. I don't know that node.attribute does what you mean.

cheers,

--aj

On Fri, Feb 6, 2015 at 5:42 PM, M G meher03@hotmail.com wrote:

Hi

When i do

knife search node name:devwsgw20150130113529 -a tomcat.user
1 items found

devwsgw20150130113529:
tomcat.user: tomcat

I see there is an attribute called tomcat.user

In recipe I am using,

tcuser=node.attribute[:tomcat][:user]
log "tc user is #{tcuser}"

When I run the chef-client on the above node, i see the following line
printed

Compiling Cookbooks...
Converging 14 resources
Recipe: update::deploy

  • log[tc user is ] action write

Why can knife search the attribute and the recipe cannot?

Please provide pointers/suggestions.

Regards

mg

oh sorry, node.debug_value(:tomcat) or (:tomcat, :user)

cheers,

--aj

On Fri, Feb 6, 2015 at 8:57 PM, AJ Christensen aj@junglistheavy.industries
wrote:

try node.debug_value(:tc, :user) in a chef-shell with the attributes
loaded or in your Recipe DSL [0]; you should be able to determine the
source of your attribute woes. Given that you have not shared with us your
attribute structure (cookbooks, roles, environments, json attributes, ohai
custom plugins) without additional diagnostics, my recommendations are
limited.

Please provide a full debug log if possible, too! -ldebug or similar.

cheers,

--aj

http://jtimberman.housepub.org/blog/2014/09/02/chef-node-dot-debug-value/

On Fri, Feb 6, 2015 at 8:47 PM, M G meher03@hotmail.com wrote:

Hi AJ

OK. I ran the recipe using your suggestion and still the variable tcuser
comes up empty when running on the node.

knife search node name:devwsgw20150130113529 -a tomcat
1 items found

devwsgw20150130113529:
tomcat:
base: /opt/apache-tomcat-7.0.54
user: tomcat

As you can see the attribute tomcat has two child attributes base and
user with values in them.

In the recipe, I have the following code:

tc=node.attribute[:tomcat][:base]
log "tc base is #{tc}"
tcuser=node['tomcat']['user']
log "tc user is #{tcuser}"

And while running it I get

  • log[tc base is /opt/apache-tomcat-7.0.54] action write

  • log[tc user is ] action write

So you see using the colon notation I am able to get the value of
tomcat's child attribute "base"
but using the colon notation and your suggested notation I get nothing.
This is strange behavior that I have not encountered .

Any suggestions/pointers ?

Regards

mg


Date: Fri, 6 Feb 2015 17:45:11 +1300
From: aj@junglistheavy.industries
To: chef@lists.opscode.com
Subject: [chef] Re: Knife search shows attributes but cannot find same
attribute in recipe

tcuser=node.attribute[:tomcat][:user]
log "tc user is #{tcuser}"

this is wrong, you want something like:

tcuser = node['tomcat']['user']

in your Recipe. I don't know that node.attribute does what you mean.

cheers,

--aj

On Fri, Feb 6, 2015 at 5:42 PM, M G meher03@hotmail.com wrote:

Hi

When i do

knife search node name:devwsgw20150130113529 -a tomcat.user
1 items found

devwsgw20150130113529:
tomcat.user: tomcat

I see there is an attribute called tomcat.user

In recipe I am using,

tcuser=node.attribute[:tomcat][:user]
log "tc user is #{tcuser}"

When I run the chef-client on the above node, i see the following line
printed

Compiling Cookbooks...
Converging 14 resources
Recipe: update::deploy

  • log[tc user is ] action write

Why can knife search the attribute and the recipe cannot?

Please provide pointers/suggestions.

Regards

mg

Hi aj
Output of chef-shell -z
chef > node.debug_value(:tomcat) => [[“set_unless_enabled?”, false], [“default”, {“user”=>“tomcat”, “base”=>"/opt/apache-tomcat-7.0.54"}], [“env_default”, :not_present], [“role_default”, :not_present], [“force_default”, :not_present], [“normal”, {“base”=>"/opt/apache-tomcat-7.0.54", “user”=>“tomcat”}], [“override”, :not_present], [“role_override”, :not_present], [“env_override”, :not_present], [“force_override”, :not_present], [“automatic”, :not_present]]chef > node.debug_value(:tomcat, :user) => [[“set_unless_enabled?”, false], [“default”, “tomcat”], [“env_default”, :not_present], [“role_default”, :not_present], [“force_default”, :not_present], [“normal”, “tomcat”], [“override”, :not_present], [“role_override”, :not_present], [“env_override”, :not_present], [“force_override”, :not_present], [“automatic”, :not_present]]chef >

Regards
mg
Date: Fri, 6 Feb 2015 21:01:12 +1300
From: aj@junglistheavy.industries
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: Knife search shows attributes but cannot find same attribute in recipe

oh sorry, node.debug_value(:tomcat) or (:tomcat, :user)
cheers,
–aj
On Fri, Feb 6, 2015 at 8:57 PM, AJ Christensen aj@junglistheavy.industries wrote:
try node.debug_value(:tc, :user) in a chef-shell with the attributes loaded or in your Recipe DSL [0]; you should be able to determine the source of your attribute woes. Given that you have not shared with us your attribute structure (cookbooks, roles, environments, json attributes, ohai custom plugins) without additional diagnostics, my recommendations are limited.
Please provide a full debug log if possible, too! -ldebug or similar.

cheers,
–aj
http://jtimberman.housepub.org/blog/2014/09/02/chef-node-dot-debug-value/

On Fri, Feb 6, 2015 at 8:47 PM, M G meher03@hotmail.com wrote:

Hi AJ
OK. I ran the recipe using your suggestion and still the variable tcuser comes up empty when running on the node.
knife search node name:devwsgw20150130113529 -a tomcat1 items found
devwsgw20150130113529: tomcat: base: /opt/apache-tomcat-7.0.54 user: tomcat
As you can see the attribute tomcat has two child attributes base and user with values in them.
In the recipe, I have the following code:
tc=node.attribute[:tomcat][:base]log "tc base is #{tc}"tcuser=node[‘tomcat’][‘user’]log "tc user is #{tcuser}"
And while running it I get

  • log[tc base is /opt/apache-tomcat-7.0.54] action write
  • log[tc user is ] action write
    So you see using the colon notation I am able to get the value of tomcat’s child attribute “base” but using the colon notation and your suggested notation I get nothing. This is strange behavior that I have not encountered .
    Any suggestions/pointers ?
    Regards
    mg
    Date: Fri, 6 Feb 2015 17:45:11 +1300
    From: aj@junglistheavy.industries
    To: chef@lists.opscode.com
    Subject: [chef] Re: Knife search shows attributes but cannot find same attribute in recipe
log "tc user is #{tcuser}"```
this is wrong, you want something like:
```tcuser = node['tomcat']['user']```
in your Recipe. I don't know that `node.attribute` does what you mean.
cheers,
--aj
On Fri, Feb 6, 2015 at 5:42 PM, M G <meher03@hotmail.com> wrote:



Hi
When i do 
knife search node name:devwsgw20150130113529 -a tomcat.user1 items found
devwsgw20150130113529:  tomcat.user: tomcat
I see there is an attribute called tomcat.user
In recipe I am using,
tcuser=node.attribute[:tomcat][:user]log "tc user is #{tcuser}"

When I run the chef-client on the above node, i see the following line printed
Compiling Cookbooks...Converging 14 resourcesRecipe: update::deploy  * log[tc user is ] action write
Why can knife search the attribute and the recipe cannot?
Please provide pointers/suggestions.
Regards
mg