yevgenko / cookbook-php-fpm

Installs/Configures php-fpm
http://community.opscode.com/cookbooks/php-fpm
Apache License 2.0
68 stars 117 forks source link

Update cookbook definition and do some general cleanup/refactoring #22

Closed ameir closed 11 years ago

ameir commented 11 years ago

Refactor code to not rely on attributes as much (use definitions similar to LWRPs) Update documentation Allow deletion of pool config file

dwradcliffe commented 11 years ago

:+1: I really don't want the testpool automatically setup.

@ameir I'd suggest setting the cookbook by default unless it's overridden, so it only needs to be set if it is not using the conf from php-fpm.

berkes commented 11 years ago

:+1: Tested and implemented this; works great. For us this change is exactly what we needed (and similar to what I was working on myself), since we want to create php-fpm-pools from data-bags.

Edit: I am getting failures now, when deploying the recipe alone. The recipe calls service-restart, but that fails to start without any pools. Either the restart should detect wether any pools are defined and skip (re)starting when no such pool found, or it should not run at all. Not running at all, has no real downsides AFAIK, since any pool-creation or update fires a restart anyway.

Edit2: https://github.com/Savvii/cookbook-php-fpm/commit/18f7e6db50392464430f85d66a8ab63aaad842a9 solves the issue where the bare recipe fails.

Note that the recipe is also ran on creating the first pool: this will also always fail without abovementioned patch,

ameir commented 11 years ago

I left a comment on your commit. Could you test if this solution works well for you? It'll at least enable the service upon creation of pools.

https://github.com/ameir/cookbook-php-fpm/commit/d2b4c6a514bddafa092be7b7197e365fe1c6e6ef

yevgenko commented 11 years ago

@ameir and everyone who participated on this, thank you guys! I'm going to do some final reviews soon and then will prepare the new release.

ameir commented 11 years ago

Thanks, @yevgenko. I added a couple of things just now; hopefully it's not too late to include in your testing. Please let me know if you have any questions.