Forge Home

sdiff

Provides suppressing diff output based on file and line regex

10,351 downloads

9,873 latest version

2.8 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 1.0.2 (latest)
  • 1.0.1
  • 1.0.0
released Mar 18th 2014
This version is compatible with:
  • Puppet Enterprise 3.2.x
  • Puppet 3.x

Start using this module

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

Add this module to your Puppetfile:

mod 'justinhennessy-sdiff', '1.0.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add justinhennessy-sdiff
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install justinhennessy-sdiff --version 1.0.2

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

justinhennessy/sdiff — version 1.0.2 Mar 18th 2014

Puppet sdiff module

A puppet module for suppressing diff output based on file and line patterns

Installation:

Install in your puppet master's modulepath as a directory named 'sdiff'. This will use the defaults or hiera if it has been configured.

include sdiff

You will need to add the following to your puppet.conf on each agent

[main]
.
.
.
.
diff=/usr/local/bin/sdiff
diff_args=-u

Usage:

For use with Hiera simply configure the following keys:

sdiff::file_pattern: '\.env'
sdiff::line_pattern: 'MERCHANT_ID=.*\|PRIVATE_KEY=.*\$'

If you want to pass in the values to the module, that is done as below:

class { 'sdiff':
  color        => false,
  file_pattern => '\.env',
  line_pattern => 'MERCHANT_ID=.*\|PRIVATE_KEY=.*\$',
}

When a file pattern is matched, sdiff will change

Notice: /Stage[main]//Node[vmx.domain.com]/Apps::Application[application]/File[/var/www/application/shared/config/staging.env]/content:
--- /var/www/application/shared/config/staging.env 2014-02-14 05:47:12.000000000 +0000
+++ /tmp/puppet-file20140218-25927-1tcg13c-0  2014-02-18 07:48:49.000000000 +0000
@@ -78,8 +78,7 @@
 TWITTER_KEY=gqZzxxxxxxxxxxxecw
 TWITTER_SECRET=xxxxxxxjE0qxxxxxxxxxxnRccTHxxxxxxxx0kN6Ag
 USE_SSL=true
-VOLUNTEERMATCH_API_KEY=cdxxxxxxxxxxc85e4077xxxxxxxxxx0026a
-VOLUNTEERMATCH_ENDPOINT=http://domain.com/api/call
+VOLUNTEERMATCH_API_KEY=70dxxxxxxxxxx8968e1xxxxxxxx05
+VOLUNTEERMATCH_ENDPOINT=http://domain2.com/api/call
 VOLUNTEERMATCH_USER=username
 ZENDESK_ENABLED=true

to

Notice: /Stage[main]//Node[vmx.domain.com]/Apps::Application[application]/File[/var/www/application/shared/config/staging.env]/content:
Suppressing potentially sensitive diff of /var/www/application/shared/config/staging.env vs /tmp/puppet-file20140314-24647-eem4az-0.

Line supression works similar but will only suppress matching lines.

Contributors:

Justin Hennessy (@justinhennessy) - Module creator

Alexandra Spillane (@ajbw) - Script template creator