Forge Home

comment_line

Comment out a line a file using Puppet

8,624 downloads

7,280 latest version

1.9 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.2.3 (latest)
  • 0.2.2
  • 0.2.1
  • 0.2.0
  • 0.1.0
released Feb 23rd 2017

Start using this module

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

Add this module to your Puppetfile:

mod 'geoffwilliams-comment_line', '0.2.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add geoffwilliams-comment_line
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install geoffwilliams-comment_line --version 0.2.3

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

geoffwilliams/comment_line — version 0.2.3 Feb 23rd 2017

Build Status

comment_line

Table of Contents

  1. Description
  2. Usage - Configuration options and additional functionality
  3. Reference - An under-the-hood peek at what the module is doing and how
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

Description

Comment/uncomment a line a file using Puppet (via awk).

Usage

Commenting

comment_line { "/foo/bar bar":
  ensure => commented
  path   => "/foo/bar",
  match  => "bar",
}

Comment all lines matching /bar/ in the file /foo/bar

Uncommenting

comment_line { "/foo/bar bam":
  ensure => uncommented
  path   => "/foo/bar",
  match  => "bam",
}

Uncomment all lines matching /bam/ in the file /foo/bar

Reference

Defined types

  • comment_line - Comment out a line matching regexp

Limitations

  • Requires awk
  • Not supported by Puppet, Inc.

Development

PRs accepted :)

Testing

This module supports testing using PDQTest.

Test can be executed with:

bundle install
bundle exec pdqtest all

See .travis.yml for a working CI example