0

I'm getting started with Chef and I've got a couple of things work which is great. I'm a little stuck though with how to use the Apache2 recipe to configure a virtual host. I have 5 hosts to set up and I'm wondering where the best place is to store this config data and how the recipe calls them.

Do I store them in a databag? If so how do I then use this data? Do I set up another recipe that calls the web_app or apache_site definition to create them?

The Chef documentation is a little thin around how you should make these kinds of modifications.

1 Answers1

0

I don't think it matters too much actually where you store it, but it would depend on what you need to do. A databag is globally available, so all of your recipes will see it but attributes can be set per server, per role, or per environment.

I would put it in a role level attribute personally. That would allow you to to create a role that would deploy a certain web app with all its dependencies. Just cycle through that attribute and call apache_site for all the apps in that role's attribute. Then put some recipes to install php/apache/mysql/whatever to fulfill the requirements for that site inside the role.

Kyle
  • 1,589
  • 9
  • 14