atomic-penguin / cookbook-krb5

Chef cookbook for Kerberos 5 authentication
Apache License 2.0
17 stars 18 forks source link

Overriding attributes #35

Closed marzdgzmn closed 5 years ago

marzdgzmn commented 6 years ago

I can't seem to override an attribute. I tried creating a wrapper cookbook and overriding default['krb5']['krb5_conf']['libdefaults']['default_realm'] with override['krb5']['krb5_conf']['libdefaults']['default_realm'] in an attribute file, however, the value doesn't seem to be propagated into the included recipe.

Tried displaying their values on attributes/default.rb, attributes/kdc.rb, and recipe/kadmin.rb, here is the output:

log.txt

americanhanko commented 6 years ago

@marzdgzmn As long as you include the recipe and set the attribute in the same cookbook, there should be no issues. No need to use node.override. For example, in a default attributes file, you'd have:

default['krb5']['krb5_conf']['libdefaults']['default_realm'] = 'REALM.MARZDGZMN.COM'

While putting include_recipe 'krb5::default' in one of your recipes.

Alternatively, you could add the krb5 default recipe to a Kitchen suite's run-list and set the attributes there.

wolf31o2 commented 5 years ago

No response in quite a while and I override attributes all over the place in my wrappers. Cannot reproduce, so closing it.