Forge Home


Share data between nodes instead of exporting resources.


45,163 latest version

2.4 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.0 (latest)
released Jul 20th 2017
This version is compatible with:
  • Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 3.7.1 < 5.0.0
  • , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'WhatsARanjit-share_data', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add WhatsARanjit-share_data
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install WhatsARanjit-share_data --version 0.1.0

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.



WhatsARanjit/share_data — version 0.1.0 Jul 20th 2017


Table of Contents

  1. Overview
  2. Example
  3. Defined Types
  4. Functions


This module allowd you to share data with other nodes instead iof only exporting resources.


Node sending data

share_data { $fqdn:
  data  => [ $hostname, $ipaddress ],
  label => 'foobar',

Node using data

$data = share_data::retrieve('foobar')

$data.each |$item| {
  host { $item[0]:
    ensure => present,
    ip     => $item[1],

file { '/tmp/mywhitelist.txt':
  ensure  => file,
  content => inline_template('<% @data.each do |val| %><%= val[0] %>:<%= val[1] %><% end %>'),

This will create host entries for each node and a file with content like:


Defined Types


Used to ship data to the master.

Share_data parameters

  • label

    Basically a tag used to call upon specific data later. Required

  • data

    What you want to share. Can be any type- String, Array, Hash, etc. Default: $title



share_data::retrieve inputs

  • label

    The label used to mark the data you want to retrieve. This function will return an Array of matching share_data items.