Hello,

I have this defined resource type which is working perfectly until I
want an ssl an http vhost pointing to the same directory in which case
the unique $servername variable became a singleton
Do you have any idea how to get around this? I am pretty tired at the
moment and cant think of any good solution.

define vhost ($servername = "${hostname}.${domain}", $serveralias = [
"www.${hostname}.${domain}" ], $inorout = "1", $owner = "root", $group
= "root", $enabled = "link", $rewrite = "", $ssl = "false", $cacert =
"", $certchain = "", $certfile = "", $keyfile = "" ) {

        $filename = $ssl ? {
                'true'  => "${servername}-ssl",
                'false' => "${servername}",
        }

        file{ "/etc/apache2/sites-available/${filename}":
                ensure          => present,
                content         => template("${module_name}/vhost.erb"),
                require         => Package['apache2'],
                notify          => Service['apache2'],
        }

        file{ "/etc/apache2/sites-enabled/${filename}":
                ensure          => "${enabled}",
                target          => "/etc/apache2/sites-available/${filename}",
                require         =>
File["/etc/apache2/sites-available/${filename}"],
                notify          => Service['apache2'],
        }

        file{ "/var/www/${servername}":
                ensure          => directory,
                owner           => "${owner}",
                group           => "${group}",
                recurse         => true,
                require         => Package['apache2'],
        }

        file{ "/var/www/${servername}/html/":
                ensure          => directory,
                require         => File["/var/www/${servername}"],
        }
}

Node configuration


node eurwebtest03 inherits eurwebtest-template {
        vhost{ 'test':
                servername      => 'test.eurweb.com',
                ssl             => 'true',
                enabled         => 'link',
                inorout         => '0';

                'test1':
                servername      => 'test.eurweb.com',
                enabled         => 'link',
                inorout         => '0';

                'test2':
                servername      => 'test2.eurweb.com',
                ssl             => 'true',
                enabled         => 'link',
                inorout         => '0';

                'test3':
                servername      => 'test3.eurweb.com',
                enabled         => 'link',
                inorout         => '0';

        }
}


Thank you

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

Reply via email to