Install mlocate and configure updatedb.conf
APACHE-2.0 License
/etc/updatedb.conf
Install mlocate or plocate and configure with default configuration.
include mlocate
Fedora 37 and newer will install plocate always since mlocate will be obsoleted by the plocate RPM allways.
Configure everything we can.
class{'mlocate':
ensure => true,
locate => 'plocate',
prunefs => ['9p', 'afs', 'autofs', 'bdev'],
prune_bind_mounts => true,
prunenames => ['.git', 'CVS'],
prunepaths => ['/afs', 'mnt' ],
period => 'daily',
force_updatedb => true,
}
The parameters prunefs
, prunenames
and prunepaths
are configured with
a unique
merge strategy within hiera so the defaults can be easily extended.
---
mlocate::prunefs:
- winnt
mlocate::prunenames:
- .cache
mlocate::prunepaths:
- /cvmfs
To override all values and set and exact parameter the lookup_options
will need to be re-defined
lookup_options:
mlocate::prunepaths:
merge: unique
mocate::prunepaths:
- /set/prunepaths/to/this/path/and/drop/defaults
or just set via parameters:
class{ 'mlocate':
prunepaths => ['just', 'this'],
}
If you wish to switch to plocate
instead you can use the locate
parameter to switch to that implementation instead.
---
mlocate::locate: plocate
Using plocate is the default for Archlinux, Debian 11 and newer, Fedora 37 and newer and RHEL 10 and newer