mirror: Add parameter to disable cron job
This commit is contained in:
parent
403c747ce4
commit
399bb1deb6
1 changed files with 8 additions and 1 deletions
|
@ -6,7 +6,10 @@
|
||||||
# $datadir:
|
# $datadir:
|
||||||
# Directory for mirrored data. Defaults to /srv/mirrors
|
# Directory for mirrored data. Defaults to /srv/mirrors
|
||||||
#
|
#
|
||||||
class mirror($datadir = "/srv/mirrors") {
|
# $cron:
|
||||||
|
# Boolean for enabling the sync-mirror cron job. Defaults to true.
|
||||||
|
#
|
||||||
|
class mirror($datadir="/srv/mirrors", $cron=true) {
|
||||||
|
|
||||||
include user::system
|
include user::system
|
||||||
realize(User["mirror"], Group["mirror"])
|
realize(User["mirror"], Group["mirror"])
|
||||||
|
@ -65,6 +68,10 @@ class mirror($datadir = "/srv/mirrors") {
|
||||||
group => "root",
|
group => "root",
|
||||||
}
|
}
|
||||||
cron { "sync-mirrors":
|
cron { "sync-mirrors":
|
||||||
|
ensure => $cron ? {
|
||||||
|
false => absent,
|
||||||
|
default => present,
|
||||||
|
},
|
||||||
command => "/usr/local/bin/sync-mirrors",
|
command => "/usr/local/bin/sync-mirrors",
|
||||||
user => "mirror",
|
user => "mirror",
|
||||||
hour => [ 0, 6, 12, 18, ],
|
hour => [ 0, 6, 12, 18, ],
|
||||||
|
|
Loading…
Add table
Reference in a new issue