Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Run fstrim from cron if using thin-p.
  • Loading branch information
purpleidea committed Apr 24, 2014
1 parent b948c83 commit 1444914
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions manifests/brick.pp
Expand Up @@ -31,6 +31,7 @@
$lvm_virtsize = '', # defaults to 100% available.
$lvm_chunksize = '', # chunk size for thin-p
$lvm_metadatasize = '', # meta data size for thin-p
$lvm_fstrim = true, # include an fstrim cron job for thin-p

$fsuuid = '', # set a uuid for this fs (uuidgen)
$fstype = '', # xfs
Expand Down Expand Up @@ -514,6 +515,21 @@
alias => "gluster-brick-mkdir ${name}",
}
}

# run fstrim periodically when using thin-p
cron { "gluster-fstrim-${safename}":
# the: > /dev/null 2>&1 disables email notifications from cron!
command => "/usr/sbin/fstrim ${valid_path} > /dev/null 2>&1",
user => root,
hour => 23, # just before midnight
ensure => $lvm_thinp ? {
true => $lvm_fstrim ? {
false => absent,
default => present,
},
default => absent,
},
}
}

# vim: ts=8

0 comments on commit 1444914

Please sign in to comment.