summaryrefslogtreecommitdiffstats
path: root/modules/locate
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-10-09 02:52:47 -0400
committerJesse Luehrs <doy@tozt.net>2018-10-09 02:52:47 -0400
commitecb88209e55d12d6fe2400e57953c21a77fae456 (patch)
tree91d6b2b7bc970cd8338558cfa1e164663fbda9e7 /modules/locate
parent4f83c1174738781ffdfcc79ce9f020071a3e976a (diff)
downloadpuppet-tozt-ecb88209e55d12d6fe2400e57953c21a77fae456.tar.gz
puppet-tozt-ecb88209e55d12d6fe2400e57953c21a77fae456.zip
add updatedb cron job, and refactor a bit
Diffstat (limited to 'modules/locate')
-rw-r--r--modules/locate/files/updatedb5
-rw-r--r--modules/locate/manifests/init.pp12
2 files changed, 17 insertions, 0 deletions
diff --git a/modules/locate/files/updatedb b/modules/locate/files/updatedb
new file mode 100644
index 0000000..21f2681
--- /dev/null
+++ b/modules/locate/files/updatedb
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+set -eu
+set -o pipefail
+
+updatedb
diff --git a/modules/locate/manifests/init.pp b/modules/locate/manifests/init.pp
index b7055d9..c977cb7 100644
--- a/modules/locate/manifests/init.pp
+++ b/modules/locate/manifests/init.pp
@@ -1,5 +1,17 @@
class locate {
+ include cron
+
package { "mlocate":
ensure => installed,
}
+
+ file {
+ '/etc/cron.daily/updatedb':
+ source => 'puppet:///modules/locate/updatedb',
+ mode => '0755',
+ require => [
+ Package['mlocate'],
+ Class['cron'],
+ ];
+ }
}