resources_deep_merge

contributions requested
provides a function deep-merges every memeber of one hash1 with hash2

11,326 downloads

11,096 latest version

3.8 quality score

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

  • 0.9.1 (latest)
  • 0.9.0
released Sep 3rd 2014

Start using this module

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

Add this module to your Puppetfile:

mod 'brainsware-resources_deep_merge', '0.9.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add brainsware-resources_deep_merge
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install brainsware-resources_deep_merge --version 0.9.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

brainsware/resources_deep_merge — version 0.9.1 Sep 3rd 2014

####Table of Contents

  1. Overview
  2. Setup - The basics of getting started with resources_deep_merge
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

##Overview

This module provides the function resources_deep_merge. It's based on stdlib deep_merge() function. Its intended use to provide hashes, such as those passed to create_resources() with default values.

##Setup

 % puppet module install brainsware-resources_deep_merge

##Usage

resources_deep_merge

Returns a deep-merged resource hash (hash of hashes).

Examples:

    $tcresource_defaults = {
      ensure     => 'present',
      attributes => {
        driverClassName => 'org.postgresql.Driver',
      }
    }

    $tcresources = {
      'app1:jdbc/db1' => {
        attributes => {
          url      => 'jdbc:postgresql://localhost:5432/db1',
          userpass => 'user1:pass1',
        },
      },
      'app2:jdbc/db2' => {
        attributes => {
          url      => 'jdbc:postgresql://localhost:5432/db2',
          userpass => 'user2:pass2',
        },
      }
    }

When called as:

    $result = resources_deep_merge($tcresources, $tcresource_defaults)

will return:

    {
     'app1:jdbc/db1' => {
       ensure     => 'present',
       attributes => {
         url      => 'jdbc:postgresql://localhost:5432/db1',
         userpass => 'user1:pass1',
         driverClassName => 'org.postgresql.Driver',
       },
     },
     'app2:jdbc/db2' => {
       ensure     => 'present',
       attributes => {
         url      => 'jdbc:postgresql://localhost:5432/db2',
         userpass => 'user2:pass2',
         driverClassName => 'org.postgresql.Driver',
       },
     }
    }
  • Type: rvalue

##Limitations

This module requires puppetlabs-stdlib >=3.2.1, which is when deep_merge() was introduced.

##Development

This module uses blacksmith for releasing and rspec for tests. All contributions are highly welcome, especially if they include documentation and tests.