puppet_file is an internal wrapper to file. I have the following: puppet_file { "pg_hba_conf": name => "/var/lib/pgsql/data/pg_hba.conf", owner => "postgres", group => "postgres", mode => 600, base => $base, require => [ Package["postgresql-server"] ], source => "var/lib/pgsql/data/pg_hba.conf"; } The RPM for postgresql-server states the following in its scripts: preinstall scriptlet (using /bin/sh): groupadd -g 26 -o -r postgres >/dev/null 2>&1 || : useradd -M -n -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \ -c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || : touch /var/log/pgsql chown postgres:postgres /var/log/pgsql chmod 0700 /var/log/pgsql postinstall scriptlet (using /bin/sh): chkconfig --add postgresql /sbin/ldconfig The puppet logs state: Jul 9 14:58:23 lhm-srv-psql02 Installed: postgresql-server.x86_64 8.3.3-1PGDG.rhel5 Jul 9 14:58:23 lhm-srv-psql02 puppetd[2624]: (//Node[lhm-srv-psql02]/postgresql83::server/Package[postgresql-server-8.3.3-1PGDG.rhel5.x86_64]/ensure) created Jul 9 14:58:38 lhm-srv-psql02 puppetd[2624]: (//Node[lhm-srv-psql02]/postgresql83::server/Exec[Init Postgres]/returns) executed successfully Jul 9 14:58:38 lhm-srv-psql02 puppetd[2624]: (//Node[lhm-srv-psql02]/Puppet_file[pg_hba_conf]/Puppet_file_nonrecurse[pg_hba_conf]/File[pg_hba_conf]) Failed to retrieve current state of resource: Could not find group postgres On a fresh build of the server, I managed to turn puppetd off from the auto-run, and ran it in debug mode. The error promptly -moved- to a different resource in the postgresql83::server class: notice: /Package[postgresql-server-8.3.3-1PGDG.rhel5.x86_64]/ensure: created info: /Package[postgresql-server-8.3.3-1PGDG.rhel5.x86_64]: Scheduling refresh of Service[postgresql] debug: //Node[lhm-srv-psql02]/postgresql83::server/File[/var/log/pglog]: File does not exist debug: //Node[lhm-srv-psql02]/postgresql83::server/File[/var/log/pglog]: Changing ensure debug: //Node[lhm-srv-psql02]/postgresql83::server/File[/var/log/pglog]: 1 change(s) err: //Node[lhm-srv-psql02]/postgresql83::server/File[/var/log/pglog]/ensure: change from absent to directory failed: Could not set directory on ensure: Could not find group postgres at /etc/puppet/manifests/services/postgres83.pp:59 debug: //Node[lhm-srv-psql02]/postgresql83::server/Exec[Init Postgres]: Changing returns debug: //Node[lhm-srv-psql02]/postgresql83::server/Exec[Init Postgres]: 1 change(s) debug: //Node[lhm-srv-psql02]/postgresql83::server/Exec[Init Postgres]: Executing ''/sbin/service postgresql initdb'' and further down the pg_hba_conf gets the group set just fine. I''ve tracked this down into type/file/group.rb and the calls to the Etc class/library (which I can''t find for the life of me). What I don''t understand is how it fails to find the group a good 15 seconds after the group has been created. Does puppet do a one-time load at start-up of all the groups and users? Am I looking at a race condition? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Andrew Shafer
2008-Jul-09 17:50 UTC
[Puppet Users] Re: Perplexing dependency chain problem
This is a known issue. http://reductivelabs.com/redmine/issues/show/791 On Wed, Jul 9, 2008 at 10:02 AM, Duncan Hill <bajandude@googlemail.com> wrote:> > puppet_file is an internal wrapper to file. > > I have the following: > puppet_file { > "pg_hba_conf": > name => "/var/lib/pgsql/data/pg_hba.conf", > owner => "postgres", > group => "postgres", > mode => 600, > base => $base, > require => [ Package["postgresql-server"] ], > source => "var/lib/pgsql/data/pg_hba.conf"; > } > > The RPM for postgresql-server states the following in its scripts: > preinstall scriptlet (using /bin/sh): > groupadd -g 26 -o -r postgres >/dev/null 2>&1 || : > useradd -M -n -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \ > -c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || : > touch /var/log/pgsql > chown postgres:postgres /var/log/pgsql > chmod 0700 /var/log/pgsql > postinstall scriptlet (using /bin/sh): > chkconfig --add postgresql > /sbin/ldconfig > > The puppet logs state: > Jul 9 14:58:23 lhm-srv-psql02 Installed: postgresql-server.x86_64 > 8.3.3-1PGDG.rhel5 > Jul 9 14:58:23 lhm-srv-psql02 puppetd[2624]: > > (//Node[lhm-srv-psql02]/postgresql83::server/Package[postgresql-server-8.3.3-1PGDG.rhel5.x86_64]/ensure) > created > Jul 9 14:58:38 lhm-srv-psql02 puppetd[2624]: > (//Node[lhm-srv-psql02]/postgresql83::server/Exec[Init > Postgres]/returns) executed successfully > Jul 9 14:58:38 lhm-srv-psql02 puppetd[2624]: > > (//Node[lhm-srv-psql02]/Puppet_file[pg_hba_conf]/Puppet_file_nonrecurse[pg_hba_conf]/File[pg_hba_conf]) > Failed to retrieve current state of resource: Could not find group > postgres > > On a fresh build of the server, I managed to turn puppetd off from the > auto-run, and ran it in debug mode. The error promptly -moved- to a > different resource in the postgresql83::server class: > notice: /Package[postgresql-server-8.3.3-1PGDG.rhel5.x86_64]/ensure: > created > info: /Package[postgresql-server-8.3.3-1PGDG.rhel5.x86_64]: Scheduling > refresh of Service[postgresql] > debug: //Node[lhm-srv-psql02]/postgresql83::server/File[/var/log/pglog]: > File does not exist > debug: //Node[lhm-srv-psql02]/postgresql83::server/File[/var/log/pglog]: > Changing ensure > debug: //Node[lhm-srv-psql02]/postgresql83::server/File[/var/log/pglog]: > 1 change(s) > err: > //Node[lhm-srv-psql02]/postgresql83::server/File[/var/log/pglog]/ensure: > change from absent to directory failed: Could not set directory on > ensure: Could not find group postgres at > /etc/puppet/manifests/services/postgres83.pp:59 > debug: //Node[lhm-srv-psql02]/postgresql83::server/Exec[Init > Postgres]: Changing returns > debug: //Node[lhm-srv-psql02]/postgresql83::server/Exec[Init > Postgres]: 1 change(s) > debug: //Node[lhm-srv-psql02]/postgresql83::server/Exec[Init > Postgres]: Executing ''/sbin/service postgresql initdb'' > > and further down the pg_hba_conf gets the group set just fine. > > I''ve tracked this down into type/file/group.rb and the calls to the > Etc class/library (which I can''t find for the life of me). What I > don''t understand is how it fails to find the group a good 15 seconds > after the group has been created. Does puppet do a one-time load at > start-up of all the groups and users? Am I looking at a race > condition? > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---