Aaron Grewell
2012-Mar-30 18:56 UTC
[Puppet Users] Does create_resources support virtual resources?
Hi all, I''m interested pushing my user list out of my users manifest and into Hiera. Unfortunately I haven''t been able to get it to work the way I thought it would. The error suggests that perhaps create_resources cannot create virtual resources, but the docs I''ve read so far don''t address it. The class (in init.pp): class users { $system_users = hiera(''system_users'') $system_groups = hiera(''system_groups'') create_resources("@users::mkuser",$system_users) create_resources("@users::mkgroup",$system_groups) } # class users The define (in mkuser.pp): define users::mkuser ( $uid, $gid = undef, $group = undef, $shell = ''/bin/bash'', $home = undef, $ensure = ''present'', $managehome = true, $dotssh = ''ensure'', $comment = ''created via puppet'', $groups = undef, $password = undef, $symlink = undef, $mode = undef ) { <SNIP> } The error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: could not create resource of unknown type @users::mkuser at /etc/puppetlabs/puppet/configurations/se/environments/development/modules/users/manifests/init.pp:29 Is this the expected behavior, or have I missed something obvious? -- 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.
Gary Larizza
2012-Mar-30 19:04 UTC
Re: [Puppet Users] Does create_resources support virtual resources?
Create_resources doesn''t support virtual users, but Hiera DOES support hash-merging, so it could find all users in all hierarchies with hiera_hash and then declare them at once. On Friday, March 30, 2012, Aaron Grewell wrote:> Hi all, > I''m interested pushing my user list out of my users manifest and into > Hiera. Unfortunately I haven''t been able to get it to work the way I > thought it would. The error suggests that perhaps create_resources > cannot create virtual resources, but the docs I''ve read so far don''t > address it. > > The class (in init.pp): > class users { > $system_users = hiera(''system_users'') > $system_groups = hiera(''system_groups'') > > create_resources("@users::mkuser",$system_users) > create_resources("@users::mkgroup",$system_groups) > } # class users > > The define (in mkuser.pp): > > define users::mkuser ( > $uid, > $gid = undef, > $group = undef, > $shell = ''/bin/bash'', > $home = undef, > $ensure = ''present'', > $managehome = true, > $dotssh = ''ensure'', > $comment = ''created via puppet'', > $groups = undef, > $password = undef, > $symlink = undef, > $mode = undef > ) { > <SNIP> > } > > The error: > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > could not create resource of unknown type @users::mkuser at > > /etc/puppetlabs/puppet/configurations/se/environments/development/modules/users/manifests/init.pp:29 > > Is this the expected behavior, or have I missed something obvious? > > -- > 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<javascript:;> > . > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com <javascript:;>. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- Gary Larizza Professional Services Engineer Puppet Labs -- 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.
Aaron Grewell
2012-Mar-30 20:10 UTC
Re: [Puppet Users] Does create_resources support virtual resources?
Thanks Gary. I''ll go figure out how that works. :) On 03/30/2012 12:04 PM, Gary Larizza wrote:> Create_resources doesn''t support virtual users, but Hiera DOES support > hash-merging, so it could find all users in all hierarchies with > hiera_hash and then declare them at once. > > On Friday, March 30, 2012, Aaron Grewell wrote: > > Hi all, > I''m interested pushing my user list out of my users manifest and into > Hiera. Unfortunately I haven''t been able to get it to work the way I > thought it would. The error suggests that perhaps create_resources > cannot create virtual resources, but the docs I''ve read so far don''t > address it. > > The class (in init.pp): > class users { > $system_users = hiera(''system_users'') > $system_groups = hiera(''system_groups'') > > create_resources("@users::mkuser",$system_users) > create_resources("@users::mkgroup",$system_groups) > } # class users > > The define (in mkuser.pp): > > define users::mkuser ( > $uid, > $gid = undef, > $group = undef, > $shell = ''/bin/bash'', > $home = undef, > $ensure = ''present'', > $managehome = true, > $dotssh = ''ensure'', > $comment = ''created via puppet'', > $groups = undef, > $password = undef, > $symlink = undef, > $mode = undef > ) { > <SNIP> > } > > The error: > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > could not create resource of unknown type @users::mkuser at > /etc/puppetlabs/puppet/configurations/se/environments/development/modules/users/manifests/init.pp:29 > > Is this the expected behavior, or have I missed something obvious? > > -- > 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 > <javascript:;>. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com <javascript:;>. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > > > -- > > Gary Larizza > Professional Services Engineer > Puppet Labs > > -- > 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.-- 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.
Seemingly Similar Threads
- Using single hiera hash for two create_resources, and mounting filesystems
- Failed to parse template, wrong number of arguments (create_resources)
- New user - Issue using Generic::Mkuser in the ghoneycutt/generic module.
- Profiles, Hiera, and create_resources('class','...')
- hiera / create_resources / define