Ask Your Question

cron package install before cron can execute

asked 2013-03-08 07:18:18 -0600

simonC gravatar image

Iwant to install cronie package before I call the cron command in puppet, but it looks like the order is not retained:

my code :

class puppet_chron {

    package {"cronie":
            ensure => installed,
            before => Cron["run-puppet"],

            command => "/usr/sbin/puppet agent --test",
            minute => inline_template("<%= hostname.hash.abs % 60 %>"),


I've tried also with Package["cronie"] -> Cron["run-puppet"] but I always get the error

err: Failed to apply catalog: Could not find a default provider for cron

I use puppet 2.6.17

Any hints?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-03-08 07:31:05 -0600

llowder gravatar image

In this version of puppet, I don't think you can install a provider in the same run as you use it. I believe that was introduced in late 2.7.

If you can, update to 3.x and this should work as you want.

If that is not an option, you'll probably need to do this in two runs - the first install the package as well as any other core, "provisiony" things (perhaps using a staging or provisioning environment) then move it to the real one and have the cron resource present.

edit flag offensive delete link more


tnx for the info ... I will try to update puppet to higher version

simonC gravatar imagesimonC ( 2013-03-08 07:50:37 -0600 )edit

Just for the record: You have to use at least 2.7.8 for the feature Lee described:

Stefan gravatar imageStefan ( 2013-03-09 01:15:03 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-03-08 07:18:18 -0600

Seen: 442 times

Last updated: Mar 08 '13