FAQ
cron::daily is actually a defined resource type, so you need to declare
that resource as opposed to including a class. If you have multiple nodes
that you would like to include the same cron job on, you can write your own
class that declares a cron resources and include that.

It's hard to say without knowing what you're trying to do, but something
like this might be a good place to start:

class crontest {
cron::daily {"test_cron_job":
minute => '0,15,30,45',
hour => '0,12',
command => '/usr/bin/derp --foo';
}
}
On Monday, October 29, 2012 4:03:30 PM UTC-7, Kevin G. wrote:

I seem to be missing something. I've copied the files from this module
https://github.com/torrancew/puppet-cron into my modulepath

$ puppet master --configprint modulepath
/etc/puppet/modules:/usr/share/puppet/modules


so it looks like this:

/etc/puppet/modules/cron-job/
/etc/puppet/modules/cron-job/manifests/
/etc/puppet/modules/cron-job/manifests/daily.pp
/etc/puppet/modules/cron-job/manifests/hourly.pp
/etc/puppet/modules/cron-job/manifests/init.pp
/etc/puppet/modules/cron-job/manifests/install.pp
/etc/puppet/modules/cron-job/manifests/job.pp
/etc/puppet/modules/cron-job/manifests/monthly.pp
/etc/puppet/modules/cron-job/manifests/weekly.pp
/etc/puppet/modules/cron-job/templates/
/etc/puppet/modules/cron-job/templates/job.erb


AFAICT from the docs I should be able to do just this in my own manifests

include daily


but all I get is

Could not find class daily


What am I doing wrong?
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/rC-QLmUwnFEJ.
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.

Search Discussions

  • Kevin G. at Oct 29, 2012 at 11:31 pm

    On Monday, October 29, 2012 4:19:11 PM UTC-7, Jenner La Fave wrote:
    cron::daily is actually a defined resource type, so you need to declare
    that resource as opposed to including a class. If you have multiple nodes
    that you would like to include the same cron job on, you can write your own
    class that declares a cron resources and include that.

    It's hard to say without knowing what you're trying to do, but something
    like this might be a good place to start:

    class crontest {
    cron::daily {"test_cron_job":
    minute => '0,15,30,45',
    hour => '0,12',
    command => '/usr/bin/derp --foo';
    }
    }
    That's what I thought at first, but doing that I get:

    Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
    resource type cron::daily


    so I figured I needed to include the file first.

    Am I still missing something?

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/DytFQBF-C1wJ.
    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.
  • Jenner La Fave at Oct 29, 2012 at 11:38 pm
    Oh, right. You need to rename /etc/puppet/modules/cron-job/ to cron/

    The outermost directory needs to match the module name which needs to be
    "cron".

    http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html
    On Monday, October 29, 2012 4:31:53 PM UTC-7, Kevin G. wrote:
    On Monday, October 29, 2012 4:19:11 PM UTC-7, Jenner La Fave wrote:

    cron::daily is actually a defined resource type, so you need to declare
    that resource as opposed to including a class. If you have multiple nodes
    that you would like to include the same cron job on, you can write your own
    class that declares a cron resources and include that.

    It's hard to say without knowing what you're trying to do, but something
    like this might be a good place to start:

    class crontest {
    cron::daily {"test_cron_job":
    minute => '0,15,30,45',
    hour => '0,12',
    command => '/usr/bin/derp --foo';
    }
    }
    That's what I thought at first, but doing that I get:

    Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
    resource type cron::daily


    so I figured I needed to include the file first.

    Am I still missing something?
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/uJi7xYKnRikJ.
    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.
  • Kevin G. at Oct 30, 2012 at 12:19 am

    On Monday, October 29, 2012 4:38:07 PM UTC-7, Jenner La Fave wrote:
    Oh, right. You need to rename /etc/puppet/modules/cron-job/ to cron/

    The outermost directory needs to match the module name which needs to be
    "cron".
    Aha! That's it, thank you!
    http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html
    So I went back and peered at that page again and even in retrospect,
    knowing the answer, it was hard to see on there, but there it is, "This
    outermost directory’s name matches the name of the module." I don't know
    how that could be any clearer, but it's still hard to see. Well, I gave
    torrancew on github a pull request to add a hint to his README.mk, maybe
    that'll help the next guy with my problem.

    Thanks so much!





    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/hd040zKsWy8J.
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedOct 29, '12 at 11:19p
activeOct 30, '12 at 12:19a
posts4
users2
websitepuppetlabs.com

2 users in discussion

Kevin G.: 2 posts Jenner La Fave: 2 posts

People

Translate

site design / logo © 2022 Grokbase