Forge Home

property

Utility type for use in defined types

8,349 downloads

8,196 latest version

4.3 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.1.1 (latest)
  • 0.1.0
released Sep 15th 2015
This version is compatible with:
  • Puppet Enterprise >=2015.2.0
  • Puppet >=4.2.1
  • , , , , , , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'reidmv-property', '0.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add reidmv-property
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install reidmv-property --version 0.1.1

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

reidmv/property — version 0.1.1 Sep 15th 2015

Property

This module provides a utility type for use in creating other defined types. It is a layer of abstraction on top of the basic Exec type, allowing the end user to think in terms of a getter, a setter, and a desired value.

Example

define custom::catfiles (
  $file1_content,
  $file2_content,
) {

  property { "example::type $title file1":
    ensure       => $file1_content,
    get_command  => "/bin/cat /tmp/file1",
    set_command  => "/bin/echo ${file1_content} > /tmp/file1",
  }

  property { "example::type $title file2":
    ensure       => $file2_content,
    get_command  => template('custom/get_file2'),
    set_command  => template('custom/set_file2'),
  }

}

The defined type could then be used as:

custom::catfiles { 'test':
  file1_content => 'cat',
  file2_content => 'tac',
}

Limitations

This is a very early proof of concept module. It is functional, but expect there to be bugs right now. At present it is also implemented as a defined type, though ideally this would be implemented as a native Ruby type.