Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Schedule a module to run in noop mode via cron
class run_noop (
$git_dir = '/opt/my_puppet_module',
) {
# Install git puppet repo into git directory
vcsrepo { $git_dir:
ensure => latest,
provider => git,
source => 'https://github.com/user/my_puppet_module.git',
revision => 'master',
}
# Add my_puppet_module crontab for root
cron { 'my_puppet_module':
command => "/usr/bin/puppet apply --verbose --noop --modulepath $git_dir --noop",
user => root,
hour => '04',
minute => '05',
require => Vcsrepo["$git_dir"],
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment