Is it possible at all? My use case is setting wildcard domain's docroot. I have a variable
$docroot = "/var/www"
and, inside apache::vhost {} I'm trying to set
virtual_docroot' => "{$docroot}/%-2+",
That however throws an error saying:
Error: Could not parse for environment production: Syntax error at ' => "$docroot/%-2+",
    docroot          => $docroot,
    serveraliases    => ['; expected '}' at /tmp/vagrant-puppet-1/manifests/init.pp:22 on node localhost
My guess is that the whole expression is treated as a regexp, and $ treated as a part of the whole expression. Hence my doubts whether that's possible at all.
 
                        
The answer turns out to be an orphaned apostrophe, misplaced after
virtual_docroot, and copied from puppetlabs-apache documentation, where the faulty code is:Removing the apostrophe fixed the problem. Answer to my question is to set that particular configuration line as:
Notice the omitted
{}characters.