Testing for errors is part of the erb game. Comment all of that out and put 
in just <%= serveraliases -%> just to see what is written to the file.

In your case above, it seems you have accounted for whether serveraliases 
is an array or empty but not a simple string which is probably what it is.

On Friday, January 9, 2015 at 8:41:20 AM UTC-7, Spriya wrote:
>
> Hi,
>
> I am having this issue:
>
>
> *Error: Failed to parse template otrs/vhost-otrs.conf.erb:*
> *  Filepath: 
> /opt/puppet/lib/ruby/site_ruby/1.9.1/puppet/parser/templatewrapper.rb*
> *  Line: 81*
> *  Detail: Could not find value for 'serveraliases' at 
> /etc/puppetlabs/puppet/modules/otrs/templates/vhost-otrs.conf.erb:7*
> * at /etc/puppetlabs/puppet/modules/otrs/manifests/apache.pp:10 on node 
> dot-pap-spr-t03.ddc.dot.state.ma.us 
> <http://dot-pap-spr-t03.ddc.dot.state.ma.us>*
>
>
> Here is my code manifests code:
>
> class otrs::apache {
>
>   include apache
>
>   apache::vhost { $otrs::sitename:
>     priority        => '01',
>     docroot         => '/var/www',
>     port            => '80',
>     serveraliases   => [ $::fqdn ],
> }
> }
>
> Here is my template:
> * cat vhost-otrs.conf.erb*
> *# OTRS Config*
> *# MaxRequestsPerChild (so no apache child will be to big!)*
> *MaxRequestsPerChild 4000*
>
> *<VirtualHost *:<%= scope.lookupvar("otrs::apache::port") %>>*
> *  ServerName <%= @name %>*
> *<%if serveraliases.is_a? Array -%>*
> *<% serveraliases.each do |name| -%><%= "  ServerAlias #{name}\n" %><% end 
> -%>*
> *<% elsif serveraliases != '' -%>*
> *<%= "  ServerAlias #{serveraliases}" -%>*
> *<% end -%>*
>
>
> Do any one knows  answer? I could not find the answer for this?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3d6e89bc-f8e9-4708-89d2-6f3408f14299%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to