Hello, I have the following define: define adduser ($shell, $group, $fullname, $ingroups = "none", $home = "none") { user { "$name": ensure => present, comment => "$fullname", gid => "$group", groups => "$ingroups", membership => minimum, shell => "$shell", home => "$home", require => Group[$group] } } and the following "call" for this define: adduser { "teste" : shell => "/bin/bash", group => "teste",fullname => "teste Workgroup",ingroups => "admin" } and ..... the following error: err: Could not run Puppet configuration client: Could not find dependency Group[teste] for User[teste] at /etc/puppet/modules/sysadmin/manifests/init.pp:13 Can somebody help me with this error? Thanks ! -- 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 Wed, Mar 31, 2010 at 6:30 PM, Darvin Denmian <darvin.denmian@gmail.com>wrote:> Hello, > > I have the following define: > > define adduser ($shell, $group, $fullname, $ingroups = "none", $home > "none") { > user { "$name": > ensure => present, > comment => "$fullname", > gid => "$group", > groups => "$ingroups", > membership => minimum, > shell => "$shell", > home => "$home", > require => Group[$group] > } > } > > and the following "call" for this define: > > adduser { > "teste" : > shell => "/bin/bash", group => "teste",fullname => "teste > Workgroup",ingroups => "admin" > } > > and ..... the following error: > > err: Could not run Puppet configuration client: Could not find > dependency Group[teste] for User[teste] at > /etc/puppet/modules/sysadmin/manifests/init.pp:13 > > Can somebody help me with this error? > > Thanks ! > >Dependencies for groups are implicit when they are listed with a user, so what you have for $ingroups (I could be wrong here), should cover you and you won''t need the require. However, where''s the group, right? You will not be able to reference an explicit dependency unless somewhere in your configuration you are declaring the Group. In the above example, you don''t have the Group declared, so most likely it is not present, hence the problem. I may be lacking some additional context, but from what you''ve shared, that looks like the problem to me. --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.
Hello , I solved this issue with the following modification: define adduser ($shell, $group, $fullname, $ingroups="", $uid="", $home="") { group { $group : ensure => present } user { $name : ensure => present, comment => "$fullname", gid => "$group", groups => $ingroups, membership => minimum, shell => $shell, home => $home, uid => $uid, } } I realy don''t know if this is the better solution, but for while is the best I can do! :) Thanks !!! On Wed, Mar 31, 2010 at 10:09 PM, Michael DeHaan <michael@puppetlabs.com> wrote:> > > On Wed, Mar 31, 2010 at 6:30 PM, Darvin Denmian <darvin.denmian@gmail.com> > wrote: >> >> Hello, >> >> I have the following define: >> >> define adduser ($shell, $group, $fullname, $ingroups = "none", $home >> "none") { >> user { "$name": >> ensure => present, >> comment => "$fullname", >> gid => "$group", >> groups => "$ingroups", >> membership => minimum, >> shell => "$shell", >> home => "$home", >> require => Group[$group] >> } >> } >> >> and the following "call" for this define: >> >> adduser { >> "teste" : >> shell => "/bin/bash", group => "teste",fullname => "teste >> Workgroup",ingroups => "admin" >> } >> >> and ..... the following error: >> >> err: Could not run Puppet configuration client: Could not find >> dependency Group[teste] for User[teste] at >> /etc/puppet/modules/sysadmin/manifests/init.pp:13 >> >> Can somebody help me with this error? >> >> Thanks ! >> > > Dependencies for groups are implicit when they are listed with a user, so > what you have for $ingroups (I could be wrong here), should cover you and > you won''t need the require. > > However, where''s the group, right? > > You will not be able to reference an explicit dependency unless somewhere in > your configuration you are declaring the Group. In the above example, you > don''t have the Group declared, so most likely it is not present, hence the > problem. > > I may be lacking some additional context, but from what you''ve shared, that > looks like the problem to me. > > --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. >-- 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.
> > define adduser ($shell, $group, $fullname, $ingroups="", $uid="", $home="") { > group { $group : > ensure => present > } > > user { $name : > ensure => present, > comment => "$fullname", > gid => "$group", > groups => $ingroups, > membership => minimum, > shell => $shell, > home => $home, > uid => $uid, > } > } >It perhaps runs the risk of referencing the group twice if you add a user with the same main group more than once. Take a look at http://docs.puppetlabs.com/guides/virtual_resources.html for how to handle that. --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.