Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note to the docs about relying on default resource attributes #35

Closed
fletchowns opened this issue Oct 2, 2014 · 1 comment
Closed

Comments

@fletchowns
Copy link

If you are setting the hostname as part of your chef converge (such as with the hostname cookbook), the certificate_manage resource does not create the expected filenames.

So if you use this:

certificate_manage "wildcard"

and your node['fqdn'] was updated during your chef run, then you end up with a file like:

/etc/pki/tls/certs/localhost.pem

(substitute localhost for whatever your original hostname was)

Instead, you have to ensure the values from the execution phase are used:

certificate_manage "wildcard" do
    cert_file lazy { "#{node['fqdn']}.pem" }
    key_file lazy { "#{node['fqdn']}.key" }
    chain_file lazy { "#{node['fqdn']}-bundle.crt" }
end

Then you end up with a filename like:

/etc/pki/tls/certs/mynode.mycompany.com.pem

I thought it might be helpful if we add a note to the readme in case anybody else gets hung up on this.

Full repro is available here.

@fletchowns fletchowns changed the title Add note to the docs about relying on fqdn Add note to the docs about relying on default resource attributes Oct 2, 2014
@fletchowns
Copy link
Author

Maybe the issue is outside of this certificate cookbook? I'm not sure...still trying to get everything to play nice together

xhost-cookbooks/system#7

3ofcoins/chef-cookbook-hostname#30

atomic-penguin added a commit that referenced this issue Feb 26, 2015
Fixed #35 Added note about lazy attribute evaluation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant