Using node.default_unless instead of node.default in _attributes

* Wrapper cookbook usually uses default level to override attributes
   of the wrapped cookbook. Here, we had a problem because if the
   wrapper cookbook was enabling sasl and was setting a relayhost
   and a user/password combination using the default level, this was
   not working because _attributes resets those attributes.

   To fix this, we now use node.default_unless which will set the
   attribute only if it's not already set ensuring that wrapper
   cookbook overriden attributes using default level are correctly
   kept when computing derived attributes.
This commit is contained in:
Matthieu Vachon
2015-08-27 17:17:30 -04:00
parent 0608f71799
commit 3445567364
6 changed files with 50 additions and 18 deletions

View File

@@ -0,0 +1,6 @@
default['postfix']['main']['smtp_sasl_auth_enable'] = 'yes'
default['postfix']['main']['relayhost'] = 'please'
default['postfix']['sasl']['smtp_sasl_user_name'] = 'keep'
default['postfix']['sasl']['smtp_sasl_passwd'] = 'us'

View File

@@ -0,0 +1,3 @@
name 'wrapper'
version '0.0.1'
description 'Wrapper cookbook, used for testing only.'

View File

@@ -0,0 +1,2 @@
include 'postfix'