Hi there puppeters :),

I hope you can help me with a situation. Namely, I will use puppet to
deploy many (I mean really many) nodes with Apache installed. The
problem I have is that for now the only way to create a vhost with a
specified ServerName is to issue the server name in the main
puppetmaster file (site.pp). It looks something like this:

        case $::hostname {
                hostname1: {vhost_default { 'hostname1.domain': }}
                hostname2: {vhost_default { 'hostname2.domain': }}

Is there a way of creating a vhost file without having to issue the
name. Meaning, that the puppetmaster reads the hostname and writes it
by itself into the template. The template looks as follows (only the
important part):

<VirtualHost *:80>
    ServerName <%= fqdn %>
    ServerAlias www.<%= fqdn %>

And the init.pp for apache with the template portion:
define vhost_default() {

        file { "/etc/apache2/sites-available/domain.conf":
                owner   => 'root',
                group   => 'root',
                mode    => 644,
                content => template( 'apache/default_vhost.erb' ),
                require => [ Package[ 'apache2' ] ]

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to