Forge Home

share_data

Share data between nodes instead of exporting resources.

35,378 downloads

35,378 latest version

2.4 quality score

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
  • RedHat
    ,
    CentOS
    ,
    SLES
    ,
    Ubuntu

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.

Download

Documentation

WhatsARanjit/share_data — version 0.1.0 Jul 20th 2017

share_data

Table of Contents

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

Overview

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

Example

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:

node1: 192.168.1.1
node2: 192.168.1.2
node3: 192.168.1.3

Defined Types

Share_data

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

Functions

share_data::retrieve()

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.