I''d like to use puppet to manage some cron jobs. Unfortunately, I do not have cron installed on my servers. So, I''d like to use puppet to install cron. Unfortunately, this doesn''t seem to work. Puppet complains about the lack of provider before it runs down the dependencies. For example, this ought complain about the lack of package, or install it: root@puppet-test:~# cat /var/tmp/puppet-cron.pp package{ "anacron": ensure => "latest", } cron {"puppet cron test": command => "echo test", hour => 0, user => "root", require => Package["anacron"], } root@puppet-test:~# puppet /var/tmp/puppet-cron.pp sh: Syntax error: Bad fd number sh: Syntax error: Bad fd number err: Could not create puppet cron test: Could not find a default provider for cron Could not find a default provider for cron Any suggestions? seph --~--~---------~--~----~------------~-------~--~----~ 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, Jul 22, 2009 at 8:35 AM, seph<seph@directionless.org> wrote:> > I''d like to use puppet to manage some cron jobs. Unfortunately, I do not > have cron installed on my servers. So, I''d like to use puppet to install > cron. Unfortunately, this doesn''t seem to work. Puppet complains about > the lack of provider before it runs down the dependencies. For example, > this ought complain about the lack of package, or install it: > > root@puppet-test:~# cat /var/tmp/puppet-cron.pp > package{ "anacron": > ensure => "latest", > } > cron {"puppet cron test": > command => "echo test", > hour => 0, > user => "root", > require => Package["anacron"], > } > > > root@puppet-test:~# puppet /var/tmp/puppet-cron.pp > sh: Syntax error: Bad fd number > sh: Syntax error: Bad fd number > err: Could not create puppet cron test: Could not find a default > provider for cron > Could not find a default provider for cronIt looks to me like the crontab provider requires that the command ''crontab'' exists, and the anacron pacakge I''m looking at doesn''t supply that. You should be fine if you install crontab as well, otherwise I think we''ll need an anacron provider.> > Any suggestions? > > seph > > > >-- Nigel Kersten nigelk@google.com System Administrator Google, Inc. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Delivered from mobile device. On Jul 22, 2009, at 8:40 AM, Nigel Kersten <nigelk@google.com> wrote:> > On Wed, Jul 22, 2009 at 8:35 AM, seph<seph@directionless.org> wrote: >> >> I''d like to use puppet to manage some cron jobs. Unfortunately, I >> do not >> have cron installed on my servers. So, I''d like to use puppet to >> install >> cron. Unfortunately, this doesn''t seem to work. Puppet complains >> about >> the lack of provider before it runs down the dependencies. For >> example, >> this ought complain about the lack of package, or install it: >> >> root@puppet-test:~# cat /var/tmp/puppet-cron.pp >> package{ "anacron": >> ensure => "latest", >> } >> cron {"puppet cron test": >> command => "echo test", >> hour => 0, >> user => "root", >> require => Package["anacron"], >> } >> >> >> root@puppet-test:~# puppet /var/tmp/puppet-cron.pp >> sh: Syntax error: Bad fd number >> sh: Syntax error: Bad fd number >> err: Could not create puppet cron test: Could not find a default >> provider for cron >> Could not find a default provider for cron > > It looks to me like the crontab provider requires that the command > ''crontab'' exists, and the anacron pacakge I''m looking at doesn''t > supply that. > > You should be fine if you install crontab as well, otherwise I think > we''ll need an anacron provider. >Is the anacron package even getting installed or is the failure occuring before the package resource is executed?> >> >> Any suggestions? >> >> seph >> >>> >> > > > > -- > Nigel Kersten > nigelk@google.com > System Administrator > Google, Inc. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sorry, package["anacron"] is a bad example, since that package doesn''t actually provide cron. But it behaves identically with package["cron"]. The issue is as Teyo describes -- the failure occurs before the package resource is ever executed. I get the same error if the package doesn''t exist, or isn''t defined. seph Teyo Tyree <teyo@reductivelabs.com> writes:> Delivered from mobile device. > > On Jul 22, 2009, at 8:40 AM, Nigel Kersten <nigelk@google.com> wrote: > >> >> On Wed, Jul 22, 2009 at 8:35 AM, seph<seph@directionless.org> wrote: >>> >>> I''d like to use puppet to manage some cron jobs. Unfortunately, I >>> do not >>> have cron installed on my servers. So, I''d like to use puppet to >>> install >>> cron. Unfortunately, this doesn''t seem to work. Puppet complains >>> about >>> the lack of provider before it runs down the dependencies. For >>> example, >>> this ought complain about the lack of package, or install it: >>> >>> root@puppet-test:~# cat /var/tmp/puppet-cron.pp >>> package{ "anacron": >>> ensure => "latest", >>> } >>> cron {"puppet cron test": >>> command => "echo test", >>> hour => 0, >>> user => "root", >>> require => Package["anacron"], >>> } >>> >>> >>> root@puppet-test:~# puppet /var/tmp/puppet-cron.pp >>> sh: Syntax error: Bad fd number >>> sh: Syntax error: Bad fd number >>> err: Could not create puppet cron test: Could not find a default >>> provider for cron >>> Could not find a default provider for cron >> >> It looks to me like the crontab provider requires that the command >> ''crontab'' exists, and the anacron pacakge I''m looking at doesn''t >> supply that. >> >> You should be fine if you install crontab as well, otherwise I think >> we''ll need an anacron provider. >> > Is the anacron package even getting installed or is the failure > occuring before the package resource is executed? > >> >>> >>> Any suggestions? >>> >>> seph >>> >>>> >>> >> >> >> >> -- >> Nigel Kersten >> nigelk@google.com >> System Administrator >> Google, Inc. >> >> > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
seph wrote:> Sorry, package["anacron"] is a bad example, since that package doesn''t > actually provide cron. But it behaves identically with > package["cron"]. > > The issue is as Teyo describes -- the failure occurs before the package > resource is ever executed. I get the same error if the package doesn''t > exist, or isn''t defined. > > seph > > Teyo Tyree <teyo@reductivelabs.com> writes: > > >> Delivered from mobile device. >> >> On Jul 22, 2009, at 8:40 AM, Nigel Kersten <nigelk@google.com> wrote: >> >> >>> On Wed, Jul 22, 2009 at 8:35 AM, seph<seph@directionless.org> wrote: >>> >>>> I''d like to use puppet to manage some cron jobs. Unfortunately, I >>>> do not >>>> have cron installed on my servers. So, I''d like to use puppet to >>>> install >>>> cron. Unfortunately, this doesn''t seem to work. Puppet complains >>>> about >>>> the lack of provider before it runs down the dependencies. For >>>> example, >>>> this ought complain about the lack of package, or install it: >>>> >>>> root@puppet-test:~# cat /var/tmp/puppet-cron.pp >>>> package{ "anacron": >>>> ensure => "latest", >>>> } >>>> cron {"puppet cron test": >>>> command => "echo test", >>>> hour => 0, >>>> user => "root", >>>> require => Package["anacron"], >>>> } >>>> >>>> >>>> root@puppet-test:~# puppet /var/tmp/puppet-cron.pp >>>> sh: Syntax error: Bad fd number >>>> sh: Syntax error: Bad fd number >>>> err: Could not create puppet cron test: Could not find a default >>>> provider for cron >>>> Could not find a default provider for cron >>>> >>> It looks to me like the crontab provider requires that the command >>> ''crontab'' exists, and the anacron pacakge I''m looking at doesn''t >>> supply that. >>> >>> You should be fine if you install crontab as well, otherwise I think >>> we''ll need an anacron provider. >>> >>> >> Is the anacron package even getting installed or is the failure >> occuring before the package resource is executed? >> >> >>>> Any suggestions? >>>> >>>> seph >>>> >>>> >>> >>> -- >>> Nigel Kersten >>> nigelk@google.com >>> System Administrator >>> Google, Inc. >>> >>> >> > > > >I do this and it works fine. People before I started used Ubuntu JeOS, which is kind of a cool idea but it doesn''t come with things most people are accustomed to like logrotate or cron. You need to require both the package and service in all your cron resources. So, best thing to do is set it in your site.pp like Cron { require => [ Package["cron"], Service["cron"] ] }. -- Joe McDonagh Operations Engineer www.colonfail.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Still fails for me. Perhaps it changed in some puppet version? root@puppet-test:~# puppet -V 0.24.8 root@puppet-test:~# cat /var/tmp/puppet-cron.pp package{ "cron": ensure => "latest", } Cron { require => [ Package["cron"], Service["cron"] ], } cron {"puppet cron test": command => "echo test", hour => 0, user => "root", } root@puppet-test:~# puppet /var/tmp/puppet-cron.pp sh: Syntax error: Bad fd number sh: Syntax error: Bad fd number err: Could not create puppet cron test: Could not find a default provider for cron Could not find a default provider for cron seph Joe McDonagh <joseph.e.mcdonagh@gmail.com> writes:> You need to require both the package and service in all your cron > resources. So, best thing to do is set it in your site.pp like Cron { > require => [ Package["cron"], Service["cron"] ] }.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
seph wrote:> Still fails for me. Perhaps it changed in some puppet version? > > root@puppet-test:~# puppet -V > 0.24.8 > > root@puppet-test:~# cat /var/tmp/puppet-cron.pp > package{ "cron": > ensure => "latest", > } > > Cron { > require => [ Package["cron"], Service["cron"] ], > } > > cron {"puppet cron test": > command => "echo test", > hour => 0, > user => "root", > } > > root@puppet-test:~# puppet /var/tmp/puppet-cron.pp > sh: Syntax error: Bad fd number > sh: Syntax error: Bad fd number > err: Could not create puppet cron test: Could not find a default > provider for cron > Could not find a default provider for cron > > seph > > Joe McDonagh <joseph.e.mcdonagh@gmail.com> writes: > > >> You need to require both the package and service in all your cron >> resources. So, best thing to do is set it in your site.pp like Cron { >> require => [ Package["cron"], Service["cron"] ] }. >> > > > >Where is your cron service definition? You''ll need something like: service { "cron": ensure => "running", require => Package["cron"]; } That is of course, how ubuntu does it. I''ve been away from my native land (rh) for a while and can''t remember if that''s the service name in rh-land. -- Joe McDonagh Operations Engineer www.colonfail.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''m running on ubuntu. Anyhow, I''m running puppet with only that file. Nothing more. So if it needs an explicit service definition, it should complain about it. Anyhow I tried it, same error. The cron thing fails out before it gets anywhere. seph Joe McDonagh <joseph.e.mcdonagh@gmail.com> writes:> seph wrote: >> Still fails for me. Perhaps it changed in some puppet version? >> >> root@puppet-test:~# puppet -V >> 0.24.8 >> >> root@puppet-test:~# cat /var/tmp/puppet-cron.pp >> package{ "cron": >> ensure => "latest", >> } >> >> Cron { >> require => [ Package["cron"], Service["cron"] ], >> } >> >> cron {"puppet cron test": >> command => "echo test", >> hour => 0, >> user => "root", >> } >> >> root@puppet-test:~# puppet /var/tmp/puppet-cron.pp >> sh: Syntax error: Bad fd number >> sh: Syntax error: Bad fd number >> err: Could not create puppet cron test: Could not find a default >> provider for cron >> Could not find a default provider for cron >> >> seph >> >> Joe McDonagh <joseph.e.mcdonagh@gmail.com> writes: >> >> >>> You need to require both the package and service in all your cron >>> resources. So, best thing to do is set it in your site.pp like Cron { >>> require => [ Package["cron"], Service["cron"] ] }. >>> >> >> > >> > Where is your cron service definition? You''ll need something like: > > service { > "cron": > ensure => "running", > require => Package["cron"]; > } > > That is of course, how ubuntu does it. I''ve been away from my native > land (rh) for a while and can''t remember if that''s the service name in > rh-land. > > -- > Joe McDonagh > Operations Engineer > www.colonfail.com > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
seph wrote:> I''m running on ubuntu. Anyhow, I''m running puppet with only that > file. Nothing more. So if it needs an explicit service definition, it > should complain about it. Anyhow I tried it, same error. The cron thing > fails out before it gets anywhere. > > seph > > > Joe McDonagh <joseph.e.mcdonagh@gmail.com> writes: > > >> seph wrote: >> >>> Still fails for me. Perhaps it changed in some puppet version? >>> >>> root@puppet-test:~# puppet -V >>> 0.24.8 >>> >>> root@puppet-test:~# cat /var/tmp/puppet-cron.pp >>> package{ "cron": >>> ensure => "latest", >>> } >>> >>> Cron { >>> require => [ Package["cron"], Service["cron"] ], >>> } >>> >>> cron {"puppet cron test": >>> command => "echo test", >>> hour => 0, >>> user => "root", >>> } >>> >>> root@puppet-test:~# puppet /var/tmp/puppet-cron.pp >>> sh: Syntax error: Bad fd number >>> sh: Syntax error: Bad fd number >>> err: Could not create puppet cron test: Could not find a default >>> provider for cron >>> Could not find a default provider for cron >>> >>> seph >>> >>> Joe McDonagh <joseph.e.mcdonagh@gmail.com> writes: >>> >>> >>> >>>> You need to require both the package and service in all your cron >>>> resources. So, best thing to do is set it in your site.pp like Cron { >>>> require => [ Package["cron"], Service["cron"] ] }. >>>> >>>> >>> >>> >> Where is your cron service definition? You''ll need something like: >> >> service { >> "cron": >> ensure => "running", >> require => Package["cron"]; >> } >> >> That is of course, how ubuntu does it. I''ve been away from my native >> land (rh) for a while and can''t remember if that''s the service name in >> rh-land. >> >> -- >> Joe McDonagh >> Operations Engineer >> www.colonfail.com >> >> >> >> > > > >I think it would be non-trivial to make the provider aware of what packages and what services it needs, which it would need to do to tell you anything more than the provider can''t be found. Is the cron package installed after you run the manifest? And what is the bad FD stuff about? Do you have a crazy .bashrc or something? -- Joe McDonagh Operations Engineer www.colonfail.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Joe McDonagh <joseph.e.mcdonagh@gmail.com> writes:> I think it would be non-trivial to make the provider aware of what > packages and what services it needs, which it would need to do to tell > you anything more than the provider can''t be found. Is the cron package > installed after you run the manifest?This is exactly the issue -- puppet dies complaining about not having a provider for cron, before ever processing the dependencies. puppet does not install the package. (So no, it''s not installed after puppet runs)> And what is the bad FD stuff about? Do you have a crazy .bashrc or > something?Beats me. This version has always done that. Someone told me it was a known bug, I''ve been ignoring it. seph --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
seph wrote:> Joe McDonagh <joseph.e.mcdonagh@gmail.com> writes: > > >> I think it would be non-trivial to make the provider aware of what >> packages and what services it needs, which it would need to do to tell >> you anything more than the provider can''t be found. Is the cron package >> installed after you run the manifest? >> > > This is exactly the issue -- puppet dies complaining about not having a > provider for cron, before ever processing the dependencies. puppet does > not install the package. (So no, it''s not installed after puppet runs) > > >> And what is the bad FD stuff about? Do you have a crazy .bashrc or >> something? >> > > Beats me. This version has always done that. Someone told me it was a > known bug, I''ve been ignoring it. > > seph > > > >IDK if you saw my previous e-mail, but did you get this from ftp.ubuntu.com or rubygems? If rubygems, I recommend removing it and getting facter and puppet packages from ftp.ubuntu.com... -- Joe McDonagh Operations Engineer www.colonfail.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
These are the ubuntu packages. root@puppet-test:~# dpkg -s puppet | grep Version Version: 0.24.8-1 root@puppet-test:~# dpkg -s facter | grep Version Version: 1.5.1-0.1 seph Joe McDonagh <joseph.e.mcdonagh@gmail.com> writes:> IDK if you saw my previous e-mail, but did you get this from > ftp.ubuntu.com or rubygems? If rubygems, I recommend removing it and > getting facter and puppet packages from ftp.ubuntu.com...--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
seph wrote:> These are the ubuntu packages. > > root@puppet-test:~# dpkg -s puppet | grep Version > Version: 0.24.8-1 > > root@puppet-test:~# dpkg -s facter | grep Version > Version: 1.5.1-0.1 > > seph > > Joe McDonagh <joseph.e.mcdonagh@gmail.com> writes: > > >> IDK if you saw my previous e-mail, but did you get this from >> ftp.ubuntu.com or rubygems? If rubygems, I recommend removing it and >> getting facter and puppet packages from ftp.ubuntu.com... >> > > > >I''m running out of ideas, I do this same thing, on the same OS and version, except I don''t run the manifest locally like that... -- Joe McDonagh Operations Engineer www.colonfail.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I got the same error when it was run from a puppetmaster, I switched to a simpler local example to debug it. If you don''t have cron installed, does puppet error out, or install it like it ought? seph Joe McDonagh <joseph.e.mcdonagh@gmail.com> writes:> I''m running out of ideas, I do this same thing, on the same OS and > version, except I don''t run the manifest locally like that...--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
seph wrote:> I got the same error when it was run from a puppetmaster, I switched to > a simpler local example to debug it. > > If you don''t have cron installed, does puppet error out, or install it > like it ought? > > seph > > Joe McDonagh <joseph.e.mcdonagh@gmail.com> writes: > > >> I''m running out of ideas, I do this same thing, on the same OS and >> version, except I don''t run the manifest locally like that... >> > > > >I could have sworn it just installs the package because I have the dependency set up. But now you''ve got me doubting myself and I don''t have JeOS machine around. I''m going to try to test this when I get a chance. -- Joe McDonagh Operations Engineer www.colonfail.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---