Puppet - pass variable with a file create command

Posted by Tim Brigham on Server Fault See other posts from Server Fault or by Tim Brigham
Published on 2012-06-05T17:52:15Z Indexed on 2012/06/05 22:41 UTC
Read the original article Hit count: 168

Filed under:

I need a way to pass a given variable - lets say thearch - to several different files within a given class. I need to be able to state the contents of this variable for each file individually.

I have tried the following:

file { "xxx":
  thearch => "i386",
  path    => "/xxx/yyyy",
  owner   => root,
  group   => root,
  mode    => 644,
  content => template("module/test.erb"),
}

This doesn't pass this variable so I can use it with a <%=thearch%> statement within the erb file as I expect.

What am I doing wrong here?

© Server Fault or respective owner

Related posts about puppet