I''m running 0.25.4. What I''d like to do is place an array of users under the default node. These users rarely change. Then within each subsequent node, have another array of users added to the original array. These users change more frequently. These users are then be snarfed into a template. The setup I''ve been using is adding all the users to one array in each node definition. I''ve read that using "+=" will add arrays to one another, but I keep getting a "Could not parse for environment testing: Syntax error at ''=''; expected ''}'' at /etc/puppet/manifests/testing/site.pp:54" error. Is "+=" just not allowed in site.pp? This is an example of what I have. site.pp ----------------------------------------------------- node basenode { $users_group = [''user0'', ''user1''] } node server1 inherits basenode { $users_group += [''user2'', ''user3'', ''user4''] } ----------------------------------------------------- What I''m expecting from the above is $users_group = [''user0'', ''user1'', ''user2'', ''user3'', ''user4''] Thanks for any help. Kent -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Fri, May 28, 2010 at 11:57 AM, Kenton Brede <kbrede@gmail.com> wrote:> I''m running 0.25.4. What I''d like to do is place an array of users > under the default node. These users rarely change. Then within each > subsequent node, have another array of users added to the original > array. These users change more frequently. These users are then be > snarfed into a template. The setup I''ve been using is adding all the > users to one array in each node definition. > > I''ve read that using "+=" will add arrays to one another, but I keep > getting a "Could not parse for environment testing: Syntax error at > ''=''; expected ''}'' at /etc/puppet/manifests/testing/site.pp:54" error. > Is "+=" just not allowed in site.pp? > > This is an example of what I have. > > site.pp > ----------------------------------------------------- > node basenode { > $users_group = [''user0'', ''user1''] > } > > node server1 inherits basenode { > $users_group += [''user2'', ''user3'', ''user4''] > }Puppet uses "+>" for appending to arrays. Here''s the feature where it was added: http://projects.puppetlabs.com/issues/1584 --Michael -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Fri, May 28, 2010 at 11:15 AM, Michael DeHaan <michael@puppetlabs.com> wrote:> On Fri, May 28, 2010 at 11:57 AM, Kenton Brede <kbrede@gmail.com> wrote: >> I''m running 0.25.4. What I''d like to do is place an array of users >> under the default node. These users rarely change. Then within each >> subsequent node, have another array of users added to the original >> array. These users change more frequently. These users are then be >> snarfed into a template. The setup I''ve been using is adding all the >> users to one array in each node definition. >> >> I''ve read that using "+=" will add arrays to one another, but I keep >> getting a "Could not parse for environment testing: Syntax error at >> ''=''; expected ''}'' at /etc/puppet/manifests/testing/site.pp:54" error. >> Is "+=" just not allowed in site.pp? >> >> This is an example of what I have. >> >> site.pp >> ----------------------------------------------------- >> node basenode { >> $users_group = [''user0'', ''user1''] >> } >> >> node server1 inherits basenode { >> $users_group += [''user2'', ''user3'', ''user4''] >> } > > Puppet uses "+>" for appending to arrays. > > Here''s the feature where it was added: > http://projects.puppetlabs.com/issues/1584Doh! Looks like me just being an idiot. I won''t even tell you..... :) Anyway "+=" is working just fine in my site.pp now. Thanks, Kent -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.