2

Puppet has the cron resource for managing the crontab, but is there a similar way of managing incrontab? I can find no writings anywhere regarding this, and to be fair, I'm extremely new to puppet (software dev helping out an overworked sysadmin).

2 Answers 2

3

There is no native support for incron but that doesn't mean you can't write a simple defined type that manages the tabs in /etc/incron.d. These would be just file resources for which Puppet has of course native support. Depending on your specific needs you could also make that defined type more complex by adding support for per-user incrontabs. These would probably require use of the Concat module.

But have a look at https://puppet.com/docs/puppet/latest/lang_defined_types.html first for more info on defined types. Could be that's all you need.

2
  • excuse my ignorance, but I have an incron line added to the incrontab, but nothing at all in /etc/incron.d/ .. if a file with a single line is added to the incron.d folder, should it load up as an incrontab ? Sep 28, 2012 at 7:05
  • 1
    Yes, system incrontabs are loaded and watched by incrond. I don't personally use or know much of incron, I just read linux.die.net/man/5/incrontab which states that system incrontabs are in /etc/incron.d and user incrontabs are created by means of incrontab and put in /var/spool/incron. So your Puppet type/module would put system incrontabs in /etc/incron.d and a user's incrontab in /var/spool/incron/<username>.
    – daff
    Sep 28, 2012 at 8:51
1

I've found a incron module at https://github.com/duritong/puppet-incron.

I have a pending pull request that adds a incron::watch defined type. It's working fine for me so far.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .