require => Package['name'] directive is not working as expected

110 views
Skip to first unread message

Basil Kurian

unread,
Oct 8, 2012, 5:14:28 AM10/8/12
to puppet...@googlegroups.com
I have this definition added in one of my class files


package { vixie-cron:  ensure => installed, }

cron { puppet:
  command => "/usr/sbin/puppetd --onetime --no-daemonize --verbose --server puppet.example.com",
  user    => root,
  hour    => '*',
  minute  => '*/15',
  require => Package[vixie-cron],
}


But i 'm getting the error that

[root@client ~]# /usr/sbin/puppetd --onetime --no-daemonize --verbose --server puppet.example.com
info: Caching catalog for client.example.com
err: Failed to apply catalog: Could not find a default provider for cron


But, If I already have the vixie-cron package installed  , then it will work.

[root@client ~]# /usr/sbin/puppetd --onetime --no-daemonize --verbose --server puppet.example.com
info: Caching catalog for client.example.com
info: Applying configuration version '1349664487'
notice: /Stage[main]/Base/Package[vixie-cron]/ensure: created
notice: Finished catalog run in 4.37 seconds


That is the 'require => Package[vixie-cron],' thing is not working as expected.


Any clues ?

--
Regards

Basil




Basil Kurian

unread,
Oct 8, 2012, 5:15:33 AM10/8/12
to puppet...@googlegroups.com

Correction



But, If I already have the vixie-cron package installed  , then it will work.

 
[root@client ~]# /usr/sbin/puppetd --onetime --no-daemonize --verbose --server puppet.example.com
info: Caching catalog for client.example.com
info: Applying configuration version '1349664509'
notice: /Stage[main]/Base/Cron[puppet]/ensure: created
notice: Finished catalog run in 0.22 seconds
--
Regards

Basil




Matthew Burgess

unread,
Oct 8, 2012, 5:25:35 AM10/8/12
to puppet...@googlegroups.com
On Mon, Oct 8, 2012 at 10:14 AM, Basil Kurian <basil...@gmail.com> wrote:
> I have this definition added in one of my class files
>
>
>> package { vixie-cron: ensure => installed, }
>>
>> cron { puppet:
>> command => "/usr/sbin/puppetd --onetime --no-daemonize --verbose
>> --server puppet.example.com",
>> user => root,
>> hour => '*',
>> minute => '*/15',
>> require => Package[vixie-cron],
>> }
>
>
>
> But i 'm getting the error that
>
>> [root@client ~]# /usr/sbin/puppetd --onetime --no-daemonize --verbose
>> --server puppet.example.com
>> info: Caching catalog for client.example.com
>> err: Failed to apply catalog: Could not find a default provider for cron

I remember running into this as well.
http://projects.puppetlabs.com/issues/11362 looks relevant but links
to a closed bug at http://projects.puppetlabs.com/issues/6907. I
didn't bother looking into it much beyond that; I just made sure that
when our RHEL boxes were kickstarted, that vixie-cron was installed
prior to the puppet client's first run.

By the looks of #6907 though, it looks like this is expected to work,
so it might be worth opening a ticket to have that investigated. I'll
see if I can reproduce on a VM here today.

Thanks,

Matt.

Basil Kurian

unread,
Oct 8, 2012, 5:40:22 AM10/8/12
to puppet...@googlegroups.com
This was fixed in #6907 and released in puppet 2.7.8

 
Now it is clear. The client that I'm using is a lower version one.

[root@client ~]# rpm -qa | grep puppet
puppet-2.6.17-2.el5




--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.




--
Regards

Basil




Basil Kurian

unread,
Oct 8, 2012, 5:57:27 AM10/8/12
to puppet...@googlegroups.com
Tried upgrading the puppet master and client to 2.7.19. and that fixed the issue :)

[root@client yum.repos.d]# rpm -qa | grep puppet
puppet-2.7.19-1.el5
[root@client yum.repos.d]#

[root@client yum.repos.d]# /usr/sbin/puppetd --onetime --no-daemonize --verbose --server puppet.example.com

info: Caching catalog for client.example.com
info: Applying configuration version '1349670321'

notice: /Stage[main]/Base/Package[vixie-cron]/ensure: created
notice: /Stage[main]/Base/Cron[puppet]/ensure: created
notice: Finished catalog run in 4.12 seconds
--
Regards

Basil




Matthew Burgess

unread,
Oct 8, 2012, 6:02:25 AM10/8/12
to puppet...@googlegroups.com
On Mon, Oct 8, 2012 at 10:40 AM, Basil Kurian <basil...@gmail.com> wrote:

> Now it is clear. The client that I'm using is a lower version one.
>
> [root@client ~]# rpm -qa | grep puppet
> puppet-2.6.17-2.el5

OK. I suspect I must have been on an old version too, when I first tested this.

Just for my own peace of mind, I've tested your manifest on a fresh 3.0.0
puppet master and it correctly installs vixie-cron, then creates the
crontab entry.

Regards,

Matt.

Basil Kurian

unread,
Oct 8, 2012, 6:03:48 AM10/8/12
to puppet...@googlegroups.com
:-)


Matt.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.




--
Regards

Basil




Reply all
Reply to author
Forward
0 new messages