Environment override attrs doesn't take precedence over node attributes

THe following is my environments/production.rb file

name "production"
description "The production environment"
override_attributes "apache2" => { "listen_ports" => [ "80", "443" ] }

And in the recipe cookbooks/application/recipes/mod_php_apache2.rb, there is

node.default['apache']['listen_ports'] = [ "8080" ] at line 22

In the wiki http://wiki.opscode.com/display/chef/Attributes, it says that the environment override_attributes will take the precedence over the node attributes. But in my every chef run, the port gets set to 8080 in the file /etc/apache2/ports.conf

Why is this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

I don't know if this is just a typo, but you show your override attribute
as [apache2][listen_ports] and the default attribute is
[apache][listen_ports] without the "2".

-Matt Moretti

On Mon, Mar 19, 2012 at 12:02 PM, Sachin Sagar Rai millisami@gmail.comwrote:

THe following is my environments/production.rb file

name "production"
description "The production environment"
override_attributes "apache2" => { "listen_ports" => [ "80", "443" ] }

And in the recipe cookbooks/application/recipes/mod_php_apache2.rb, there
is

node.default['apache']['listen_ports'] = [ "8080" ] at line 22

In the wiki http://wiki.opscode.com/display/chef/Attributes, it says that
the environment override_attributes will take the precedence over the
node attributes. But in my every chef run, the port gets set to 8080 in the
file /etc/apache2/ports.conf

Why is this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow http://www.sparrowmailapp.com/?sig

@Matt, thanks.
So stupid of me that I didn't see that.


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Monday, March 19, 2012 at 10:31 PM, Matthew Moretti wrote:

I don't know if this is just a typo, but you show your override attribute as [apache2][listen_ports] and the default attribute is [apache][listen_ports] without the "2".

-Matt Moretti

On Mon, Mar 19, 2012 at 12:02 PM, Sachin Sagar Rai <millisami@gmail.com (mailto:millisami@gmail.com)> wrote:

THe following is my environments/production.rb file

name "production"
description "The production environment"
override_attributes "apache2" => { "listen_ports" => [ "80", "443" ] }

And in the recipe cookbooks/application/recipes/mod_php_apache2.rb, there is

node.default['apache']['listen_ports'] = [ "8080" ] at line 22

In the wiki http://wiki.opscode.com/display/chef/Attributes, it says that the environment override_attributes will take the precedence over the node attributes. But in my every chef run, the port gets set to 8080 in the file /etc/apache2/ports.conf

Why is this?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)