[chef] Re: apache, multiple vhosts with different ports


Chronological Thread 
  • From: Adam Durana < >
  • To:
  • Subject: [chef] Re: apache, multiple vhosts with different ports
  • Date: Mon, 6 Jun 2011 14:08:30 -0400

Hi Moritz,

Have you tried the override_attributes approach that you outlined?  I had a similar problem where I had an attribute that was an array (like listen_ports is in the apache2 cookbook) and I wanted add to items to that attribute across multiple roles.  What I found was that Chef would merge the different definitions of the attribute from override_attributes in different roles.  For example, you should be able to use override_attributes to set listen_ports to ["80"] in one role and then add to that array by setting listen_ports to ["443", "8080"] in another role and including both roles in a node's run list.

I don't know specifically why this works, I just happened to stumble upon it.  So if it doesn't work for you, let me know and I'll see if I can figure out specifically how it is working for me.

--Adam

On Fri, May 27, 2011 at 12:55 PM, Moritz Krinke < "> > wrote:
Hello,

i'm trying to have multiple apache vhosts, which use different ports on multiple servers - but not every vhost on every server.

I have a custom recipe for every "vhost" which i include in vhost-specific roles. (its the apache2 cookbook from opscode repo, modified the default recipe)

Now i need to specify which ports apache should listen on.
I could use override_attribute in the role file, but then other ports, e.g. the default port or ports from other roles get overridden.
I have tried setting the listen_ports in the recipe itself which results in a apache restart on every chef-client run.

I assume that this is not an uncommon problem, and i also assume that there is a clean way to solve it - i'm new to chef, so if anyone would have a clue i would be graceful! ;)

Thanks,

Moritz



--
Adam Durana
Moodlerooms, Inc.
Tel: 410-779-3398





  • [chef] Re: apache, multiple vhosts with different ports, Adam Durana, 06/06/2011

Archive powered by MHonArc 2.6.16.

§