Forge Home

mlocate

Manage the mlocate package for updatedb/locate.

1,165,762 downloads

8,145 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.4.0 (latest)
  • 0.3.2
  • 0.3.1
  • 0.2.1
  • 0.2.0
  • 0.1.2
  • 0.1.1
released Jun 10th 2017
This version is compatible with:
  • Puppet Enterprise 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >=3.4.0
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'adamcrews-mlocate', '0.4.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add adamcrews-mlocate
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install adamcrews-mlocate --version 0.4.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

adamcrews/mlocate — version 0.4.0 Jun 10th 2017

mlocate

Build Status Puppet Forge

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with mlocate
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module
  8. Contributors

Overview

Install and manage the mlocate/updatedb package.

Module Description

Mlocate is a useful tool that does a find of your system and records the files present. It's a bit old, not commonly used, irrelevant on disposable systems, but I like it, so get off my lawn.

Setup

What mlocate affects

  • installs the mlocate package
  • removes the default cron job, and replaces it with one that is splayed via fqdn_rand

Setup Requirements

You need a modern puppetlabs/stdlib.

Beginning with mlocate

Everything can be configured via the default mlocate class.

Usage

Basic usage that will result is a setup very close to a default CentOS configuration

include ::mlocate

Exclude some directories:

class { '::mlocate':
  extra_prunepaths => [ '/exports', '/data' ],
}

Reference

Classes

Public Classes

  • mlocate: Main class, includes other classes.

Private Classes

  • mlocate::params: default parameters.
  • mlocate::install: install and configure the software.
  • mlocate::cron: setup the cron job.

###Parameters

The following parameters are available as options to the default mlocate class.

####package_name

The name of the package to install. Default: mlocate

####package_ensure

Ensure the package is present, latest, or absent. Default: present

####update_command

The name of the updatedb wrapper script. Default: /usr/local/bin/mlocate.cron

####update_on_install

Run an initial update when the package is installed. Default: true

####conf_file

The configuration file for updatedb. Default: /etc/updatedb.conf

####cron_ensure

Ensure the cron jobs is present or absent. Default: present

####cron_schedule

The standard cron time schedule. Default: once a week based on fqdn_rand

####cron_daily_path

The path to cron.daily file installed by mlocate and that is removed

####prune_bind_mounts

Prune out bind mounts or not. Default: yes Refer to the updatedb.conf man page for more detail. On redhat 5 systems defaults to none.

####prunenames

Prune out directories matching this pattern. Default: .git .hg .svn Refer to the updatedb.conf man page for more detail. On redhat 5 systems defaults to none.

####extra_prunenames

Prune out additional directories matching this pattern. Default: none

####prunefs

Prune out these FS types. Default: refer to the params.pp Refer to the updatedb.conf man page for more detail.

####extra_prunefs

Prune out additional directories matching this pattern. Default: none

####prunepaths

Prune out paths matching this pattern. Default: refer to params.pp Refer to the updatedb.conf man page for more detail.

####extra_prunepaths

Prune out additional directories matching this pattern. Default: none

Limitations

This has only been tested on CentOS 6.5, but should work fine on any RHEL based system, versions 4+

Development

Please add spec tests, and submit PR's from a branch.

ToDo

More spec tests are needed.

Misc

With the 0.3.0 release, the cron job times will likely change as an extra seed argument has been added to the fqdn_rand function calls. This is a workaround for https://tickets.puppetlabs.com/browse/PUP-5646

Contributors

Contributors can be found on github.