Hi, I have several Debian servers with puppet 0.23.2. Part of my manifest looks like this: class virt_all_users { @group { "andy": ensure => "present", gid => "1000" } @user { "andy": ensure => "present", uid => "1000", gid => "andy", groups => "adm", membership => "inclusive", require => Group["andy"], comment => "Andy Smith", home => "/home/andy", shell => "/bin/bash" } } This group and user are realized in another class. On two of my servers, this results in puppet making a group change at every run: Sep 8 17:02:36 corona puppetd[6182]: Starting configuration run Sep 8 17:02:37 corona puppetd[6182]: (//basenode/virt_all_users/User[andy]/groups) groups changed ''adm,adm'' to ''adm'' Sep 8 17:02:37 corona puppetd[6182]: Finished configuration run in 1.05 seconds Sep 8 17:32:38 corona puppetd[6182]: Starting configuration run Sep 8 17:32:38 corona puppetd[6182]: (//basenode/virt_all_users/User[andy]/groups) groups changed ''adm,adm'' to ''adm'' Sep 8 17:32:39 corona puppetd[6182]: Finished configuration run in 0.97 seconds Sep 8 18:02:39 corona puppetd[6182]: Starting configuration run Sep 8 18:02:39 corona puppetd[6182]: (//basenode/virt_all_users/User[andy]/groups) groups changed ''adm,adm'' to ''adm'' Sep 8 18:02:40 corona puppetd[6182]: Finished configuration run in 0.78 seconds The same happens with all users that are realized, but only on these two machines. All the other machines appear to make the change only once, when the users are first created. If I set membership to "minimum" instead then the same thing happens, but the group "andy" is added also. Is this a bug or am I just doing something wrong? Cheers, Andy _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday 08 September 2007, Andy Smith wrote:> Hi, > > I have several Debian servers with puppet 0.23.2. Part of my > manifest looks like this: > > class virt_all_users { > @group { "andy": > ensure => "present", > gid => "1000" > } > > @user { "andy": > ensure => "present", > uid => "1000", > gid => "andy", > groups => "adm", > membership => "inclusive", > require => Group["andy"], > comment => "Andy Smith", > home => "/home/andy", > shell => "/bin/bash" > } > } > > This group and user are realized in another class. > > On two of my servers, this results in puppet making a group change > at every run: > > Sep 8 17:02:36 corona puppetd[6182]: Starting configuration run > Sep 8 17:02:37 corona puppetd[6182]: > (//basenode/virt_all_users/User[andy]/groups) groups changed ''adm,adm'' to > ''adm'' Sep 8 17:02:37 corona puppetd[6182]: Finished configuration run in > 1.05 seconds Sep 8 17:32:38 corona puppetd[6182]: Starting configuration > run > Sep 8 17:32:38 corona puppetd[6182]: > (//basenode/virt_all_users/User[andy]/groups) groups changed ''adm,adm'' to > ''adm'' Sep 8 17:32:39 corona puppetd[6182]: Finished configuration run in > 0.97 seconds Sep 8 18:02:39 corona puppetd[6182]: Starting configuration > run > Sep 8 18:02:39 corona puppetd[6182]: > (//basenode/virt_all_users/User[andy]/groups) groups changed ''adm,adm'' to > ''adm'' Sep 8 18:02:40 corona puppetd[6182]: Finished configuration run in > 0.78 seconds > > The same happens with all users that are realized, but only on these > two machines. All the other machines appear to make the change only > once, when the users are first created. > > If I set membership to "minimum" instead then the same thing > happens, but the group "andy" is added also. Is this a bug or am I > just doing something wrong?Are you sure you have the same (which one?) version of puppet on those servers? Regards, David - -- The primary freedom of open source is not the freedom from cost, but the free- dom to shape software to do what you want. This freedom is /never/ exercised without cost, but is available /at all/ only by accepting the very different costs associated with open source, costs not in money, but in time and effort. - -- http://www.schierer.org/~luke/log/20070710-1129/on-forks-and-forking -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFG4wyv/Pp1N6Uzh0URAlqrAJ9yyz9xvCbAEXnDusZRPJ7Ssy+pTQCbBQDq 4TcwLLe9YMSj1KWtQWoZ//k=cGbc -----END PGP SIGNATURE-----
Hi David, On Sat, Sep 08, 2007 at 10:57:14PM +0200, David Schmitt wrote:> On Saturday 08 September 2007, Andy Smith wrote: > > Hi, > > > > I have several Debian servers with puppet 0.23.2.> Are you sure you have the same (which one?) version of puppet on those > servers?Yes, all servers have the above version. Cheers, Andy _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Sep 8, 2007, at 1:17 PM, Andy Smith wrote:> The same happens with all users that are realized, but only on these > two machines. All the other machines appear to make the change only > once, when the users are first created. > > If I set membership to "minimum" instead then the same thing > happens, but the group "andy" is added also. Is this a bug or am I > just doing something wrong?The code looks right; there must be something weird coming back from the system that makes Puppet see ''adm,adm'' instead of just ''adm''. Is anyone else experiencing this? Note that we''ve had problems on Debian where Ruby will always return ''root'' as the user''s primary group, instead of the user''s actual group, but that was fixed around 0.23.0 (it appears to be a problem in the C library). -- If all the world''s a stage, I want to operate the trap door. -- Paul Beatty --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
I''m not getting duplicate groups, however I have always seen groups printed out on every run such as Sep 10 10:47:31 ADM01 puppetd: (//default/basenode/user_bfinney/d_user[Brian Finney]/User[bfinney]/groups) groups changed ''users'' to ''users'' I thought I read some where that this was to be expected. Brian On 9/10/07, Luke Kanies <luke@madstop.com> wrote:> On Sep 8, 2007, at 1:17 PM, Andy Smith wrote: > > > The same happens with all users that are realized, but only on these > > two machines. All the other machines appear to make the change only > > once, when the users are first created. > > > > If I set membership to "minimum" instead then the same thing > > happens, but the group "andy" is added also. Is this a bug or am I > > just doing something wrong? > > The code looks right; there must be something weird coming back from > the system that makes Puppet see ''adm,adm'' instead of just ''adm''. > > Is anyone else experiencing this? > > Note that we''ve had problems on Debian where Ruby will always return > ''root'' as the user''s primary group, instead of the user''s actual > group, but that was fixed around 0.23.0 (it appears to be a problem > in the C library). > > -- > If all the world''s a stage, I want to operate the trap door. > -- Paul Beatty > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
On Sep 10, 2007, at 12:52 PM, Brian Finney wrote:> I''m not getting duplicate groups, however I have always seen groups > printed out on every run such as > Sep 10 10:47:31 ADM01 puppetd: > (//default/basenode/user_bfinney/d_user[Brian > Finney]/User[bfinney]/groups) groups changed ''users'' to ''users'' > > I thought I read some where that this was to be expected.Nope, that''s a bug. Are you using the latest version? -- Men will wrangle for religion; write for it; fight for it; die for it; anything but live for it. --Charles Caleb Colton --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Just finally got around to upgrading last week [root@ADM01 ~]# puppetd --version 0.23.2 [root@ADM01 ~]# puppetmasterd --version 0.23.2 lsbdistdescription => Red Hat Enterprise Linux ES release 4 (Nahant Update 4) I''ve experienced this with all previous version also (actually something I was planning on looking into once I found some time to dig into the code). I there an underlying system package I should check the version of? On 9/10/07, Luke Kanies <luke@madstop.com> wrote:> On Sep 10, 2007, at 12:52 PM, Brian Finney wrote: > > > I''m not getting duplicate groups, however I have always seen groups > > printed out on every run such as > > Sep 10 10:47:31 ADM01 puppetd: > > (//default/basenode/user_bfinney/d_user[Brian > > Finney]/User[bfinney]/groups) groups changed ''users'' to ''users'' > > > > I thought I read some where that this was to be expected. > > Nope, that''s a bug. Are you using the latest version? > > -- > Men will wrangle for religion; write for it; fight for it; die for it; > anything but live for it. --Charles Caleb Colton > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
On Sep 10, 2007, at 2:52 PM, Brian Finney wrote:> Just finally got around to upgrading last week > > [root@ADM01 ~]# puppetd --version > 0.23.2 > [root@ADM01 ~]# puppetmasterd --version > 0.23.2 > lsbdistdescription => Red Hat Enterprise Linux ES release 4 (Nahant > Update 4)Drat.> I''ve experienced this with all previous version also (actually > something I was planning on looking into once I found some time to dig > into the code). I there an underlying system package I should check > the version of?I''m not really sure what the package would be called, but we work around the problem that we saw (which basically was that getpwnam always returned ''root'' but iterating over the entries worked fine). Maybe your library is broken in the opposite way or something. :/ -- To have a right to do a thing is not at all the same as to be right in doing it. -- G. K. Chesterton --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
If you can point me toward the appropriate file I can throw in some debug commands later today. On the command line I tend to rely on the groups command to tell me what groups a user is in, it''s been reliable on every version of Linux I''ve come across, of course using a library is usually better than executing a command. Thanks Brian On 9/10/07, Luke Kanies <luke@madstop.com> wrote:> On Sep 10, 2007, at 2:52 PM, Brian Finney wrote: > > > Just finally got around to upgrading last week > > > > [root@ADM01 ~]# puppetd --version > > 0.23.2 > > [root@ADM01 ~]# puppetmasterd --version > > 0.23.2 > > lsbdistdescription => Red Hat Enterprise Linux ES release 4 (Nahant > > Update 4) > > Drat. > > > I''ve experienced this with all previous version also (actually > > something I was planning on looking into once I found some time to dig > > into the code). I there an underlying system package I should check > > the version of? > > I''m not really sure what the package would be called, but we work > around the problem that we saw (which basically was that getpwnam > always returned ''root'' but iterating over the entries worked fine). > Maybe your library is broken in the opposite way or something. :/ > > -- > To have a right to do a thing is not at all the same as to be right > in doing it. -- G. K. Chesterton > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
On Mon, Sep 10, 2007 at 12:52:58PM -0700, Brian Finney wrote:> Just finally got around to upgrading last week > > [root@ADM01 ~]# puppetd --version > 0.23.2 > [root@ADM01 ~]# puppetmasterd --version > 0.23.2 > lsbdistdescription => Red Hat Enterprise Linux ES release 4 (Nahant Update 4) > > I''ve experienced this with all previous version also (actually > something I was planning on looking into once I found some time to dig > into the code). I there an underlying system package I should check > the version of?Are you using the default rhel4 ruby or have you switched to a newer version? Kostas
On Sep 10, 2007, at 4:28 PM, Brian Finney wrote:> If you can point me toward the appropriate file I can throw in some > debug commands later today. > > On the command line I tend to rely on the groups command to tell me > what groups a user is in, it''s been reliable on every version of Linux > I''ve come across, of course using a library is usually better than > executing a command.The ''groups'' method, which is responsible for returning the correct list of current group membership, is at line 273 in lib/puppet/ provider/nameservice.rb. -- When a man tells you that he got rich through hard work, ask him: ''Whose?'' --Don Marquis --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
[bfinney@ADM01 push]$ ruby --version ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux] I am using an updated version of ruby, however I remember experiencing these exact same results when I first started using puppet on the default rhel4 ruby packages. On 9/10/07, Kostas Georgiou <k.georgiou@imperial.ac.uk> wrote:> On Mon, Sep 10, 2007 at 12:52:58PM -0700, Brian Finney wrote: > > > Just finally got around to upgrading last week > > > > [root@ADM01 ~]# puppetd --version > > 0.23.2 > > [root@ADM01 ~]# puppetmasterd --version > > 0.23.2 > > lsbdistdescription => Red Hat Enterprise Linux ES release 4 (Nahant Update 4) > > > > I''ve experienced this with all previous version also (actually > > something I was planning on looking into once I found some time to dig > > into the code). I there an underlying system package I should check > > the version of? > > Are you using the default rhel4 ruby or have you switched to a newer > version? > > Kostas > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
On Mon, Sep 10, 2007 at 04:11:17PM -0700, Brian Finney wrote:> [bfinney@ADM01 push]$ ruby --version > ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux] > > I am using an updated version of ruby, however I remember experiencing > these exact same results when I first started using puppet on the > default rhel4 ruby packages.This version has a broken Etc.getgrid from what I remember, have a look at https://bugzilla.redhat.com/show_bug.cgi?id=236647 for details. I suspect that this is causing your problems, it doesn''t explain why you were getting errors from the original one as well though. Cheers, Kostas
It appears that my current install does not have the bug described [bfinney@ADM01 push]$ grep bfinney /etc/passwd bfinney:x:1001:501:Brian Finney:/home/bfinney:/bin/bash [bfinney@ADM01 push]$ ruby --version ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux] [bfinney@ADM01 push]$ irb --version irb 0.9.5(05/04/13) [bfinney@ADM01 push]$ irb irb(main):001:0> require ''etc'' => true irb(main):002:0> Etc.getgrgid(1001) => #<struct Struct::Group name="bfinney", passwd="x", gid=501, mem=[]> irb(main):003:0> exit [bfinney@ADM01 push]$ rpm -q ruby ruby-1.8.6-2.mixxer_rhel4 On 9/10/07, Kostas Georgiou <k.georgiou@imperial.ac.uk> wrote:> On Mon, Sep 10, 2007 at 04:11:17PM -0700, Brian Finney wrote: > > > [bfinney@ADM01 push]$ ruby --version > > ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux] > > > > I am using an updated version of ruby, however I remember experiencing > > these exact same results when I first started using puppet on the > > default rhel4 ruby packages. > > This version has a broken Etc.getgrid from what I remember, have > a look at https://bugzilla.redhat.com/show_bug.cgi?id=236647 for > details. > > I suspect that this is causing your problems, it doesn''t explain why > you were getting errors from the original one as well though. > > Cheers, > Kostas > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
I ran the ''groups'' method through erb [bfinney@ADM01 push]$ groups bfinney bfinney : bfinney users [bfinney@ADM01 push]$ irb irb(main):001:0> require ''etc'' => true irb(main):002:0> groups = [] => [] irb(main):003:0> Etc.setgrent => nil irb(main):004:0> user = ''bfinney'' => "bfinney" irb(main):005:0> while group = Etc.getgrent irb(main):006:1> members = group.mem irb(main):007:1> if members.include? user irb(main):008:2> groups << group.name irb(main):009:2> end irb(main):010:1> end => nil irb(main):011:0> Etc.endgrent => nil irb(main):012:0> groups.join(",") => "users" Sense bfinney is my users native group I would only expect to see "users" result from this method which it did, and this matches the out put of puppet and what puppet believes it is setting the groups to. I''m going to dig a little deeper to see what I can find. On 9/10/07, Luke Kanies <luke@madstop.com> wrote:> On Sep 10, 2007, at 4:28 PM, Brian Finney wrote: > > > If you can point me toward the appropriate file I can throw in some > > debug commands later today. > > > > On the command line I tend to rely on the groups command to tell me > > what groups a user is in, it''s been reliable on every version of Linux > > I''ve come across, of course using a library is usually better than > > executing a command. > > The ''groups'' method, which is responsible for returning the correct > list of current group membership, is at line 273 in lib/puppet/ > provider/nameservice.rb. > > -- > When a man tells you that he got rich through hard work, ask > him: ''Whose?'' --Don Marquis > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
On Mon, Sep 10, 2007 at 05:02:02PM -0700, Brian Finney wrote:> It appears that my current install does not have the bug described > > [bfinney@ADM01 push]$ grep bfinney /etc/passwd > bfinney:x:1001:501:Brian Finney:/home/bfinney:/bin/bash > [bfinney@ADM01 push]$ ruby --version > ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux] > [bfinney@ADM01 push]$ irb --version > irb 0.9.5(05/04/13) > [bfinney@ADM01 push]$ irb > irb(main):001:0> require ''etc'' > => true > irb(main):002:0> Etc.getgrgid(1001) > => #<struct Struct::Group name="bfinney", passwd="x", gid=501, mem=[]> > irb(main):003:0> exit > [bfinney@ADM01 push]$ rpm -q ruby > ruby-1.8.6-2.mixxer_rhel4I had a quick look at the svn sources and 1.8.6 patchlevel 0 seems to have it. The description of the bug is slightly wrong though it returns the entry for the gid of the running process and not root. What do you get if you run Etc.getgrgid(0), Etc.getgrgid(1), etc.?
I believe I found the problem I added print "{{bfinney-DEBUG " + tmp + " == " + self.should + "}}" on line 215 of type/user.rb which for root produced {{bfinney-DEBUG adm,bin,daemon,disk,sys,wheel =bin,daemon,sys,adm,disk,wheel}}{{bfinney-DEBUG adm,bin,daemon,disk,sys,wheel =bin,daemon,sys,adm,disk,wheel}}notice: //default/basenode/user_root/d_user[root]/User[root]/groups: groups changed ''bin,daemon,sys,adm,disk,wheel'' to ''bin,daemon,sys,adm,disk,wheel'' showing that the return from should is not properly sorted. Looking at the code for should the return is dependent on the if statement at line 185 which is true for my manifest so in theory line 186 is some how not sorting correctly return @should.sort.join(",") I also added a print statement to should to verify that it is overriding correctly. From the docs it looks like the @ simply makes it an instance variable and I have no idea how that would stop sort from working. On 9/10/07, Brian Finney <y0gi636@gmail.com> wrote:> I ran the ''groups'' method through erb > [bfinney@ADM01 push]$ groups bfinney > bfinney : bfinney users > [bfinney@ADM01 push]$ irb > irb(main):001:0> require ''etc'' > => true > irb(main):002:0> groups = [] > => [] > irb(main):003:0> Etc.setgrent > => nil > irb(main):004:0> user = ''bfinney'' > => "bfinney" > irb(main):005:0> while group = Etc.getgrent > irb(main):006:1> members = group.mem > irb(main):007:1> if members.include? user > irb(main):008:2> groups << group.name > irb(main):009:2> end > irb(main):010:1> end > => nil > irb(main):011:0> Etc.endgrent > => nil > irb(main):012:0> groups.join(",") > => "users" > > Sense bfinney is my users native group I would only expect to see > "users" result from this method which it did, and this matches the out > put of puppet and what puppet believes it is setting the groups to. > > I''m going to dig a little deeper to see what I can find. > > On 9/10/07, Luke Kanies <luke@madstop.com> wrote: > > On Sep 10, 2007, at 4:28 PM, Brian Finney wrote: > > > > > If you can point me toward the appropriate file I can throw in some > > > debug commands later today. > > > > > > On the command line I tend to rely on the groups command to tell me > > > what groups a user is in, it''s been reliable on every version of Linux > > > I''ve come across, of course using a library is usually better than > > > executing a command. > > > > The ''groups'' method, which is responsible for returning the correct > > list of current group membership, is at line 273 in lib/puppet/ > > provider/nameservice.rb. > > > > -- > > When a man tells you that he got rich through hard work, ask > > him: ''Whose?'' --Don Marquis > > --------------------------------------------------------------------- > > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > > > > _______________________________________________ > > Puppet-users mailing list > > Puppet-users@madstop.com > > https://mail.madstop.com/mailman/listinfo/puppet-users > > >
When I run this function as a different user I do get the bug your talking about, it always returns the gid of the current user rather than the target gid. On 9/10/07, Kostas Georgiou <k.georgiou@imperial.ac.uk> wrote:> On Mon, Sep 10, 2007 at 05:02:02PM -0700, Brian Finney wrote: > > > It appears that my current install does not have the bug described > > > > [bfinney@ADM01 push]$ grep bfinney /etc/passwd > > bfinney:x:1001:501:Brian Finney:/home/bfinney:/bin/bash > > [bfinney@ADM01 push]$ ruby --version > > ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux] > > [bfinney@ADM01 push]$ irb --version > > irb 0.9.5(05/04/13) > > [bfinney@ADM01 push]$ irb > > irb(main):001:0> require ''etc'' > > => true > > irb(main):002:0> Etc.getgrgid(1001) > > => #<struct Struct::Group name="bfinney", passwd="x", gid=501, mem=[]> > > irb(main):003:0> exit > > [bfinney@ADM01 push]$ rpm -q ruby > > ruby-1.8.6-2.mixxer_rhel4 > > I had a quick look at the svn sources and 1.8.6 patchlevel 0 seems to > have it. The description of the bug is slightly wrong though it returns > the entry for the gid of the running process and not root. > > What do you get if you run Etc.getgrgid(0), Etc.getgrgid(1), etc.? > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
I got a chance to look at this again and it looks like when should is using @should @should is an array containing one value which is the array joined with '',''. In other words at line 187 of type/user.rb @should == ["my,list,of,groups"] Which eventually led me to double check my manifest and realized that I had my groups set as "my,list,of,groups" rather that [my,list,of,groups] Obviously this was technically incorrect but it did have the correct results on the systems. Thanks for the help Brian On 9/10/07, Brian Finney <y0gi636@gmail.com> wrote:> I believe I found the problem > > I added > > print "{{bfinney-DEBUG " + tmp + " == " + self.should + "}}" > > on line 215 of type/user.rb which for root produced > > {{bfinney-DEBUG adm,bin,daemon,disk,sys,wheel => bin,daemon,sys,adm,disk,wheel}}{{bfinney-DEBUG > adm,bin,daemon,disk,sys,wheel => bin,daemon,sys,adm,disk,wheel}}notice: > //default/basenode/user_root/d_user[root]/User[root]/groups: groups > changed ''bin,daemon,sys,adm,disk,wheel'' to > ''bin,daemon,sys,adm,disk,wheel'' > > showing that the return from should is not properly sorted. Looking > at the code for should the return is dependent on the if statement at > line 185 which is true for my manifest so in theory line 186 is some > how not sorting correctly > > return @should.sort.join(",") > > I also added a print statement to should to verify that it is > overriding correctly. From the docs it looks like the @ simply makes > it an instance variable and I have no idea how that would stop sort > from working. > > On 9/10/07, Brian Finney <y0gi636@gmail.com> wrote: > > I ran the ''groups'' method through erb > > [bfinney@ADM01 push]$ groups bfinney > > bfinney : bfinney users > > [bfinney@ADM01 push]$ irb > > irb(main):001:0> require ''etc'' > > => true > > irb(main):002:0> groups = [] > > => [] > > irb(main):003:0> Etc.setgrent > > => nil > > irb(main):004:0> user = ''bfinney'' > > => "bfinney" > > irb(main):005:0> while group = Etc.getgrent > > irb(main):006:1> members = group.mem > > irb(main):007:1> if members.include? user > > irb(main):008:2> groups << group.name > > irb(main):009:2> end > > irb(main):010:1> end > > => nil > > irb(main):011:0> Etc.endgrent > > => nil > > irb(main):012:0> groups.join(",") > > => "users" > > > > Sense bfinney is my users native group I would only expect to see > > "users" result from this method which it did, and this matches the out > > put of puppet and what puppet believes it is setting the groups to. > > > > I''m going to dig a little deeper to see what I can find. > > > > On 9/10/07, Luke Kanies <luke@madstop.com> wrote: > > > On Sep 10, 2007, at 4:28 PM, Brian Finney wrote: > > > > > > > If you can point me toward the appropriate file I can throw in some > > > > debug commands later today. > > > > > > > > On the command line I tend to rely on the groups command to tell me > > > > what groups a user is in, it''s been reliable on every version of Linux > > > > I''ve come across, of course using a library is usually better than > > > > executing a command. > > > > > > The ''groups'' method, which is responsible for returning the correct > > > list of current group membership, is at line 273 in lib/puppet/ > > > provider/nameservice.rb. > > > > > > -- > > > When a man tells you that he got rich through hard work, ask > > > him: ''Whose?'' --Don Marquis > > > --------------------------------------------------------------------- > > > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > > > > > > > _______________________________________________ > > > Puppet-users mailing list > > > Puppet-users@madstop.com > > > https://mail.madstop.com/mailman/listinfo/puppet-users > > > > > >
On Mon, Sep 10, 2007 at 11:33:35AM -0500, Luke Kanies wrote:> On Sep 8, 2007, at 1:17 PM, Andy Smith wrote: > > > The same happens with all users that are realized, but only on these > > two machines. All the other machines appear to make the change only > > once, when the users are first created. > > > > If I set membership to "minimum" instead then the same thing > > happens, but the group "andy" is added also. Is this a bug or am I > > just doing something wrong? > > The code looks right; there must be something weird coming back from > the system that makes Puppet see ''adm,adm'' instead of just ''adm''.Ah, I see: $ getent group | grep ''andy'' adm:x:4:andy andy:x:1000:andy adm:x:4:andy andy:x:1000:andy I think it''s because those two machines also fall through to LDAP: /etc/nsswitch.conf: ... passwd: files ldap compat group: files ldap compat ... and removing the " compat" fixed this. Cheers, Andy _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users