Module to search a string within a file. If found, either display a message, or remove it.




4,500 latest version

4.6 quality score

Version information

  • 0.1.2 (latest)
  • 0.1.1
  • 0.1.0
released Aug 7th 2017
This version is compatible with:
  • Ubuntu

Start using this module


steroidg/snd — version 0.1.2 Aug 7th 2017

snd (search and destroy)

Table of Contents

  1. Description
  2. Setup
  3. Usage
  4. Reference
  5. Limitations
  6. Development


This snd (search and destroy) module can be used to search a string within a file and perform 2 types of actions if found:

  • Return true so puppet registers an action has been performed (default).
  • Delete the file.

This module can be used to detect problems in a file where deleting it is the easiest fix. I mainly use it for files automatically generated by other programs. By example DUID file for DHCPv6 clients.


What snd affects

The snd module only affects file(s) if specified.

Beginning with snd

There are 2 ways you can obtain this module.


You can use the module by including it:

include snd

Doing so won't have any effect until data hash is provided via hiera in the following format:

    search_str: '[search_string]'
    display_only: true/false

By example, to delete the file /tmp/foo if a line contains a line with 'answer is 42':

    search_str: '^answer is 42$'
    display_only: false


The reference of this module can be generated by puppet strings. There are 3 ways you can access the content:

  • Refer it in the official documentation.
  • Git checkout the gh-pages branch of the module repository.
  • Re-generate the reference locally by running puppet strings within the module directory.


This module is tested on Ubuntu LTS against Puppet 5, but it'll probably work on other Linux distributions.


Please feel free to clone, use, play, comment and create pull requests. Let's see how it goes.