diff options
author | Jesse Luehrs <doy@tozt.net> | 2018-11-13 00:19:06 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2018-11-13 00:19:06 -0500 |
commit | bf33ac997636c4b6c199cfff1e171ffaff437c91 (patch) | |
tree | 2f3d94f0ad3fddde69fec83c4d65356d60dea479 /modules/locate | |
parent | b5fe67cdda8f05ffe814a923b1a69f7169b9db5c (diff) | |
download | puppet-tozt-bf33ac997636c4b6c199cfff1e171ffaff437c91.tar.gz puppet-tozt-bf33ac997636c4b6c199cfff1e171ffaff437c91.zip |
actually, let's make this shared again
Diffstat (limited to 'modules/locate')
-rw-r--r-- | modules/locate/files/updatedb | 5 | ||||
-rw-r--r-- | modules/locate/manifests/init.pp | 26 |
2 files changed, 31 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 new file mode 100644 index 0000000..182e3b4 --- /dev/null +++ b/modules/locate/manifests/init.pp @@ -0,0 +1,26 @@ +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'], + ]; + } + + exec { "initial updatedb run": + command => "/etc/cron.daily/updatedb", + creates => "/var/lib/mlocate/mlocate.db", + require => [ + File["/etc/cron.daily/updatedb"], + Package['mlocate'], + ] + } +} |