Closed ameir closed 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.
:+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,
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
@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.
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.
Refactor code to not rely on attributes as much (use definitions similar to LWRPs) Update documentation Allow deletion of pool config file