Ask Your Question

Apache Vhost Defined type

asked 2013-04-09 15:54:34 -0600

kdoswald gravatar image

updated 2013-04-13 11:25:45 -0600

jonn gravatar image

I would like to setup apache to manage are vhosts.

Standard define apache::vhost ($port, $serveralias).. etc

But we are using DSR so have multiple entries for each vhost because of all the IP's allocated to that host. Is their a way to use a array to pupulate multiple fields at one time? Rather then have variables for each one.. or have to add multiple apahce::vhost to my site.pp.

edit retag flag offensive close merge delete


Sorry should have been more clear. Quickly written example what I would like. So could pass it multiple ip address's and generate apache vhost config ...(more)

kdoswald gravatar imagekdoswald ( 2013-04-09 16:58:21 -0600 )edit

See my answer about create resources.

Ancillas gravatar imageAncillas ( 2013-04-11 11:01:31 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-04-09 16:07:20 -0600

Ancillas gravatar image

updated 2013-04-09 16:09:25 -0600

It's really hard to determine what you're trying to accomplish without code samples, and your question is confusing the way it's worded, but I'll take a stab and suggest using create_resources.

create_resources('apache::vhost', $vhost_hash)

$vhost_hash would be a hash that defined each vhost, and its parameters. The create_resources function then loops through the hash and creates a resource for each entry and its children.

create_resources GitHub Page

edit flag offensive delete link more


I suppose you could pass in a super large data structure, and parse it within your ERB template, but since you're using a defined type, you may as well ...(more)

Ancillas gravatar imageAncillas ( 2013-04-11 11:02:17 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-04-09 15:54:34 -0600

Seen: 2,320 times

Last updated: Apr 09 '13