sous-chefs / certificate

Development repository for the certificate cookbook
https://supermarket.chef.io/cookbooks/certificate
73 stars 43 forks source link

Use lazy attribute evaluation for the fqdn references #46

Closed fletchowns closed 9 years ago

fletchowns commented 9 years ago

In order to be compatible with cookbooks that set the hostname during a converge like the system cookbook, can we change the references to node['fqdn'] to use lazy attribute evaluation? See this issue for some background info.

I had to use this the following as a workaround:

some_cert = certificate_manage "wildcard" do
  cert_file lazy { "#{node['fqdn']}.pem" }
  key_file lazy { "#{node['fqdn']}.key" }
  chain_file lazy { "#{node['fqdn']}-bundle.crt" }
end
fletchowns commented 9 years ago

This would also fix issue #35.

atomic-penguin commented 9 years ago

I am hesitant to fix something in the LWRP which you can work around when calling the resource.

This lazy evaluation seems like something that is probably not widely needed by most people using the cookbook. It is also a change that could impact compatibility with older versions of Chef.

fletchowns commented 9 years ago

I ran into the issue pretty quickly as a newcomer to chef, thought it might be helpful for others. Didn't realize there's a risk of impacting compatibility with older versions of Chef. Maybe just #35 then?

atomic-penguin commented 9 years ago

Yeah, a documentation update would be apropos. Care to draft it and send a pull request?