- From:
- To:
- Subject: [chef] Re: Re: using env attr to override a default
- Date: Tue, 27 Sep 2011 11:32:22 -0700
On Tue, 27 Sep 2011, AJ Christensen wrote:
>
Yo,
>
>
Your environments attributes are wrong:
>
>
On 27 September 2011 17:49,
>
<
>
>
wrote:
>
>
>
> first, the prod and dev environments:
>
>
>
> [chef-repo]$ knife environment show dev
>
> chef_type: environment
>
> cookbook_versions:
>
> default_attributes:
>
> mail-client:
>
> relayhost: mungbeans.dev.dorqtown.com
>
> mail-server:
>
> relayhost: [smtp.gmail.com]:587
>
> description: Development environment (dev)
>
> json_class: Chef::Environment
>
> name: dev
>
> override_attributes:
>
>
this should be:
>
default_attributes "postfix" => { "relayhost" => "whatever" }
>
>
The attributes are deep merged together onto the node and thus the
>
atribute structure must remain the same. Does this make sense?
>
>
If you can post the on-disk, ruby version of the environment files I
>
can point out the problem, otherwise good luck!
i can show you the json version of the env files. i was trying to
cobble together the ruby, but not getting it quickly. for the sake of
speed i'll show the json. i see what you're saying about attribute
structure, so i corrected it, i believe. but the client's relayhost
in main.cf is still picking up the setting from the postfix cookbook
attr setting rather than the dev env setting.
[chef-repo]$ cat environments/dev.json
{
"name": "dev",
"default_attributes": {
"postfix": {
"mail-server": {
"relayhost": "[outbound.mailhop.org],[smtp.gmail.com]:587"
},
"mail-client": {
"relayhost": "mungbeans.dev.dorqtown.com"
}
}
},
"json_class": "Chef::Environment",
"description": "Development environment (dev)",
"chef_type": "environment"
}
[chef-repo]$ knife node show sous-chef1.dev.dorqtown.com -r
run_list: role[mail-client]
[sous-chef1-dev ~]# grep relayhost /etc/postfix/main.cf
relayhost = mailrelay.dev.dorqtown.com
where to look?
Archive powered by MHonArc 2.6.16.