Possible to do array with foreman puppet parameters

In the Edit Host screen I was to add Parameters as an array. Is this
possible when using Foreman as an external node configuration tool for
puppet?

eg.

projects:
- foreman
- puppet
- redhat

This was avoided on purpose as Puppet doesn't necessary know how to handle
complex data structures (e.g. Arrays, Hashes etc).
the common workaround for this, is to use a CSV value, e.g.:
projects = foreman,puppet,redhat

and then, if you need it in your manifest, use the split function - e.g.:
$myvar = split($projects,",")

and if you need it in a template use the split ruby function - e.g.:
<% projects.split(",").each do |project| -%>
<%= project.upcase %>
<% end -%>

Ohad

··· On Wed, Jun 9, 2010 at 3:04 AM, Chuck wrote:

In the Edit Host screen I was to add Parameters as an array. Is this
possible when using Foreman as an external node configuration tool for
puppet?

eg.

projects:

  • foreman
  • puppet
  • redhat


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.comforeman-users%2Bunsubscribe@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

Chuck,

We used to use arrays the way you do.
They definitely make templates easier and the YAML looks cleaner.

However, we found the benefit of using Foreman and all its other
features more important than having arrays.

We ended up using something very similar to Ohads example here.

··· On Tue, Jun 8, 2010 at 7:15 PM, Ohad Levy wrote: > This was avoided on purpose as Puppet doesn't necessary know how to handle > complex data structures (e.g. Arrays, Hashes etc). > the common workaround for this, is to use a CSV value, e.g.: > projects = foreman,puppet,redhat > > and then, if you need it in your manifest, use the split function - e.g.: > $myvar = split($projects,",") > > and if you need it in a template use the split ruby function - e.g.: > <% projects.split(",").each do |project| -%> > <%= project.upcase %> > <% end -%> > > Ohad > > On Wed, Jun 9, 2010 at 3:04 AM, Chuck wrote: >> >> In the Edit Host screen I was to add Parameters as an array. Is this >> possible when using Foreman as an external node configuration tool for >> puppet? >> >> >> eg. >> >> projects: >> - foreman >> - puppet >> - redhat >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To post to this group, send email to foreman-users@googlegroups.com. >> To unsubscribe from this group, send email to >> foreman-users+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/foreman-users?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to > foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en. >