From ecb88209e55d12d6fe2400e57953c21a77fae456 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 9 Oct 2018 02:52:47 -0400 Subject: add updatedb cron job, and refactor a bit --- modules/locate/files/updatedb | 5 +++++ modules/locate/manifests/init.pp | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 modules/locate/files/updatedb (limited to 'modules/locate') 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'], + ]; + } } -- cgit v1.2.3-54-g00ecf