> This seems like it's a bug with plusassignment to me, can you open a
> ticket on this?
> 

I had a moment of inspiration this morning and figured out what I needed to
do to get this working the way I wanted:

class foo {
  $file_content = template('foo/foo-base','foo/foo-bar')
  file { "/etc/foo":
    content => $file_content,
  }
}

class foo::bab inherits foo {
  $foo::file_content += template('foo/foo-bab')
  File["/etc/foo"]{
    content => $foo::file_content,
  }
}

I believe this is the way the plussignment operator should work, so you can
avoid the hackish use of variables like I'm doing above.

My primary motivation for this is something like sudoers, where certain
system roles require sudoers commands for different groups to use.  A
perfect example from our environment is any system that has an
Oracle-related role requires sudoers commands for the DBAs, on top of the
base roles we as Linux admins require on every system.  Essentially I want
to avoid having to list every template combination for every possible
permutation of roles.

An alternative to this would be to allow the template() function to take a
list as a variable, something like this:

$template_list = ["template1","template2","template3"]
content => template($template_list),

When I try that currently, I get the following error (which is a weird
error in and of itself):

err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Syntax error at '['; expected ']' at ...



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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