chef-cookbooks / chef-server

Cookbook to install standalone Chef Server

Home Page:http://supermarket.chef.io/cookbooks/chef-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't interact with Chef Server until first run is complete.

luckymike opened this issue · comments

Because the default recipe only runs the chef-server-ctl reconfigure with a delayed notification, it's impossible to interact with the installed chef server via another cookbook in the same run list.

/etc/ospcode/pivotal.rb is not put in place until a reconfigure runs, so other chef-server-ctl commands fail. Effectively, this cookbook can only be used in a standalone scenario.

This cookbook specifically is for a standalone configuration, stated in the read me.

What the cookbook does vs. whether the cookbook can be included in another run list that does more are different things. If the intention is that this cookbook can only run standalone, that's fair.

Perhaps a little more information on the use case I have, which I think should work and which did work in prior versions:

When building a standalone, no-add-on chef server, I would like to be able to include a recipe which performs some follow up tasks such as org creation, user create, updating user keys, etc. (see https://github.com/hw-cookbooks/chef-server-populator). Essentially, I would like to be able to use chef to bring my standalone server into a usable state.

As-is, this is impossible, because the config file that's necessary to perform actions against the chef server (/etc/ospcode/pivotal.rb) isn't written until chef-server-ctl reconfigure runs the first time.

I don't think this fall outside the scope you've described. It could be remedied with a simple :immediately on the chef server config notifies. If that sounds acceptable, I'm happy to open a PR with that change.

Notifying :immediately will cause an infinite notification loop. It's possible that the newly added :reconfigure action for the chef_server_ingredient resource by @stephenlauck may be helpful for this.

Yes, that was the intention of https://github.com/opscode-cookbooks/chef-server-ingredient/blob/master/libraries/chef_server_ingredients_resource.rb#L20. Think we should make that the default in this cookbook?

Making a PR for @luckymike to test now 😸

Cool, thanks! I thought the :immediately was hack-y. I used the :reconfigure action in the populator as a workaround to confirm the issue, so hopeful that PR will restore my sanity.