- From: Gilles Devaux <
>
- To: Gilles Devaux <
>
- Cc:
- Subject: [chef] Re: strange behavior in chef-server
- Date: Wed, 3 Mar 2010 21:54:55 -0800
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=ZRhE690HVT5N88l6sO6J37ssryYYfJeT7/lvyijBkLhaH2poLX1q4rKmt947Gb8Xfa pb0QeGPC3pH1tlPt5QOLXu8sqlyTBD7gQumfvNSQs+iAqR6+cmA9JOZsrUgDV56+ZY0k NVMg5xiX502lD03/zsABsV9zvC311zeYi+6p8=
I have solved the first issue, my bad between 'default' and 'override'
I have also solved the second issue but I believe there is a bug in the
client when dealing with arrays
if the role file defines:
backends => [
{ :name => "ws1", :ip => "IP" },
{ :name => "ws2", :ip => "IP2" }
],
after upload and update on the client
then knife node show NODE > dump.json
returns
"haproxy": {
"listenip": "173.203.240.198",
"backends": [
{
"name": "ws1",
"ip": "173.203.240.235"
},
{
"name": "ws2",
"ip": "173.203.240.235"
},
{
"name": "ws1",
"ip": "173.203.240.235"
},
{
"name": "ws2",
"ip": "173.203.240.235"
}
]
for the 'attribute' section
-> the list is duplicated
When I define the role file as follow:
:backends =>
{
:ws1 => "173.203.240.235",
:ws2 => "173.203.240.235"
},
and change the template accordingly
Then everything works as expected
Thanks
--Gilles
On Mar 3, 2010, at 9:07 PM, Gilles Devaux wrote:
>
More info for the second issue, using knife I have a better output.
>
>
The duplicate ws1 entry is in the 'attribute' section, the correct list is
>
in the 'default' section.
>
>
It seems the record in the 'attribute' section comes form the node itself.
>
Now my new settings are in the override section (appears like this in the
>
web-ui too) but the knife output puts them in 'default'.
>
>
If the client received them in the 'default' section then this could
>
explain my first problem, the templates not being regenerated.
>
>
I have been able to change the value in the 'attribute' section or delete
>
them from the web-ui. I have also changed the template a bit to force a new
>
compilation and it seems that the attributes get duplicated:
>
>
passing
>
> :backends => [
>
> { :name => "ws1", :ip => "IP" },
>
> { :name => "ws2", :ip => "IP2" }
>
> ],
>
>
>
produces
>
# real servers
>
server ws1 IP1 check slowstart 1000
>
server ws2 IP2 check slowstart 1000
>
server ws1 IP1 check slowstart 1000
>
server ws2 IP2 check slowstart 1000
>
>
this is my template:
>
# real servers
>
<% @node[:haproxy][:backends].each do |backend| -%>
>
server <%= backend[:name] %> <%= backend[:ip] %> check slowstart 1000
>
<%end-%>
>
>
I'll continue to investigate, in the meantime if someone think about
>
something :)
>
>
Thanks
>
>
--Gilles
>
>
On Mar 3, 2010, at 7:31 PM, Gilles Devaux wrote:
>
>
> Hi,
>
>
>
> I am running chef 0.8.4 on both server and client and I see the following
>
> behaviors:
>
>
>
> - updating attributes in a role, uploading to the server and launching
>
> chef-client does not trigger the templates to be regenerated, only a
>
> modification of the 'source' file seems to trigger it.
>
>
>
> - The server seems to send strange arguments:
>
>
>
> override_attributes "haproxy" => {
>
> :backends => [
>
> { :name => "ws1", :ip => "IP" },
>
> { :name => "ws2", :ip => "IP2" }
>
> ],
>
> :listenip => 'IP'
>
> }
>
>
>
> is passed as:
>
> "haproxy"=>{"listenip"=>"173.203.240.198", "check"=>"check.txt",
>
> "backends"=>[{"name"=>"ws1", "ip"=>"IP1"}, {"name"=>"ws1", "ip"=>"IP1"}]}
>
>
>
> and
>
>
>
> "haproxy"=>{"listenip"=>"173.203.240.198",
>
> "backends"=>{"0"=>{"name"=>"ws1", "ip"=>"IP1"}, "1"=>{"name"=>"ws2",
>
> "ip"=>"IP2"}}}}
>
>
>
> in another section, I haven't been able to isolate the parent, the dump is
>
> too big and I have format errors.
>
>
>
> Thanks
>
>
>
> --Gilles
>
>
>
Archive powered by MHonArc 2.6.16.