On 2011-11-29 15:37 , Tim Dunphy wrote:
> Hello list,
> 
>  I am having a  problem with template file. Why are variables not 
> interpolated?
> 
> [root@puppet manifests]# cat /etc/motd
> memory free = <%= memoryfree %>
> domain = <%= domain %>
> operating system = <%= operatingsystem %>
> 
>  This is the template file
> 
> [root@puppet manifests]# cat ../templates/motd.erb
> memory free = <%= memoryfree %>
> domain = <% domain %>
> operating system = <% operatingsystem %>
> 
> This is the puppet resource
> 
> [root@puppet manifests]# cat /etc/puppet/manifests/motd.pp
> file { "/etc/motd":
>     group => 'root',
>     owner => 'root',
>     mode => '440',
>     source => "/etc/puppet/templates/motd.erb"
> }
> 
> 
> thanks in advance
> tim

You need to tell Puppet that it's actually a template, not a raw file.
Try something like this?

file { "/etc/motd":
    group => 'root',
    owner => 'root',
    mode => '440',
    content => template("motd.erb"),
}

-- 
Jacob Helwig
http://about.me/jhelwig

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to