Skip to content

Instantly share code, notes, and snippets.

@marshyski
Created September 17, 2015 20:16
Show Gist options
  • Save marshyski/bbeec3a6c74a35634cbf to your computer and use it in GitHub Desktop.
Save marshyski/bbeec3a6c74a35634cbf to your computer and use it in GitHub Desktop.
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