Template updated every chef run


#1

Hi all. Just strange situation, can’t figure out.
I have in attributes:

default[“grim”][“conf”][“max.value”] = nil
default[“grim”][“conf”][“max.value.per.day”] = nil

in role:

default_attributes(
:grim => {
“conf” => {
“max.value.per.day” => 2
}
}
)

in template:

<% node[‘grim’][‘conf’].each do |attr| %>
<% if !attr[1].nil? %>
<%= “#{attr[0]} =” %> <%= “#{attr[1]}” %>
<% end %>
<% end %>


  • template[/home/user/my.conf] action create
    • update template[/home/user/my.conf] from e3b0c4 to c4a9ba
      — /home/user/my.conf 2013-11-08 17:18:10.000000000 +0000
      +++ /tmp/chef-rendered-template20131108-14338-13hq1u3 2013-11-08
      17:18:11.000000000 +0000
      @@ -0,0 +1 @@
      +max.value.per.day = 2

Chef Client finished, 3 resources updated

Why every chef run, I get the file update?


#2

Uf, it’s my inattention, just duplicated code in the separate recipes.

On Fri, Nov 8, 2013 at 7:56 PM, nowarry@gmail.com wrote:

Hi all. Just strange situation, can’t figure out.
I have in attributes:

default[“grim”][“conf”][“max.value”] = nil
default[“grim”][“conf”][“max.value.per.day”] = nil

in role:

default_attributes(
:grim => {
“conf” => {
“max.value.per.day” => 2
}
}
)

in template:

<% node[‘grim’][‘conf’].each do |attr| %>
<% if !attr[1].nil? %>
<%= “#{attr[0]} =” %> <%= “#{attr[1]}” %>
<% end %>
<% end %>


  • template[/home/user/my.conf] action create
    • update template[/home/user/my.conf] from e3b0c4 to c4a9ba
      — /home/user/my.conf 2013-11-08 17:18:10.000000000 +0000
      +++ /tmp/chef-rendered-template20131108-14338-13hq1u3 2013-11-08
      17:18:11.000000000 +0000
      @@ -0,0 +1 @@
      +max.value.per.day = 2

Chef Client finished, 3 resources updated

Why every chef run, I get the file update?