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

Template supermarket json #6

Conversation

stephenlauck
Copy link

I would like to manage the supermarket.json with a template instead of writing it out as a file. I am also not sure it's a good idea to do checking on the values and fail but better to just leave it to the user to make sure they populate the correct values.

mode "0644"
action :create
notifies :reconfigure, 'chef_server_ingredient[supermarket]'
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please add newline to the EOF and then I'm 👍

@david-crowder
Copy link

The current implementation seems to allow you to place any attribute you want in the supermarket.json (for instance if you want to disable ['nginx']['force_ssl'] 😃), but the new template only supports a handful of config.

@irvingpop
Copy link

@david-crowder your sentiments are why I'm hesitant to merge this. I also like the flexibility of the JSON output.

@stephenlauck I'm worried that we'd be breaking a number of existing user's use cases like David's with this PR. How do you think we should proceed?

@stephenlauck
Copy link
Author

I agree with the above and I think it's a good idea to just take whatever hash is assembled from the cookbook attributes/recipes and just drop the key value pairs into the template. I'll try to get to this or if @david-crowder or @irvingpop want to pair up and fix this let me know.

@irvingpop
Copy link

@stephenlauck what's the advantage of doing that with a template vs just writing out the attributes to JSON like it's doing now?

@stephenlauck
Copy link
Author

I was thinking that we may end up with a more complicated template like chef-server https://github.com/chef-cookbooks/chef-server/blob/master/templates/default/chef-server.rb.erb

@irvingpop
Copy link

I still don't see how that's better :)

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

Successfully merging this pull request may close these issues.

4 participants