brint / wordpress-cookbook

Development repository for Opscode Cookbook wordpress
https://supermarket.chef.io/cookbooks/wordpress
Apache License 2.0
80 stars 176 forks source link

Please separate web server configuration #42

Open et304383 opened 10 years ago

et304383 commented 10 years ago

I do not use the apache2 cookbook. I want to be able to install Wordpress without necessarily configuration a virtual host entry. Please separate this or at least allow it to be done conditionally based on an attribute.

brint commented 10 years ago

I was thinking about setting up a basic LWRP like #33 that would allow you to install WordPress to a location. A first version wouldn't include a setup for a web server config. Do you think that would work?

et304383 commented 10 years ago

At the very least remove trying to do things with apache or nginx. Keep the cookbook compartmentalized. If I want to have a web server running along with a virtual host then let me specify that in my run list / cookbook. Keep cookbooks small and focused on a single thing so they remain flexible. Right now I can't use your cookbook because of this! :(

brint commented 10 years ago

Does #45 get you there? If not, we can combine this with #33 for making a LWRP.

et304383 commented 10 years ago

Perhaps, but it doesn't solve the root issue in that this cookbook is trying to do too much.

It should not do anything with installation of apache, nginx, or mysql. The problems have just been moved around. It's better than it was, but the dependencies are still in the metadata.

For example, you require the mysql cookbook 5.x or above. I am still using 4.x. I have to comment out this dependency in my fork. This could be eliminated if you did not try to install mysql server in this cookbook and you didn't try to install the mysql gem. https://github.com/brint/wordpress-cookbook/blob/master/recipes/database.rb#L24

I admit I should be moving to the 5.x mysql cookbook, but it's just not an option right now.

alanbrent commented 10 years ago

@eric-tucker It seems to me that if we're going to treat Wordpress as an application, we want it to be fully working simply by including the recipe reflecting the preferred flavor: nginx or Apache. I might be misunderstanding your needs, though.

et304383 commented 10 years ago

This comes up far too often when discussing the philosophy of Chef and where the declaration of a run list belongs.

I am an advocate of roles - I want my run list defined in one place. Others are advocates of swiss army knife cookbooks that can be run without the need for a role to define the run list of prerequisites.

As long as flexibility is given such that I do not get this all-inclusive behaviour by default (eg installation of apache in the wordpress default recipe) or when trying to use a utility recipe (eg wordpress database recipe installing mysql), I am satisfied.

Roles are there for a specific reason. I believe in their purpose and that's why I avoid including recipes (from other cookbooks) in a recipe. As soon as I start doing this I begin to question what I'm trying to accomplish with the cookbook in question. The more specific you make it the less flexible it becomes for edge cases.

alanbrent commented 10 years ago

I can see where you’re coming from, and it seems that we’re getting into matters that will take actual work to implement :) I think @brint is welcoming all comers who might want to take a stab at adding an LWRP

brint commented 9 years ago

First draft of the LWRP has been explained in #33, this will allow a WordPress installation to be done without any php or web server configuration. This is an attempt to follow the growing convention of using libraries to do the heavy lifting. Once wordpress::app is converted to use the LWRP, and a bit more testing is added, I'll merge it into master and publish another release.