share_data

Share data between nodes instead of exporting resources.

WhatsARanjit

WhatsARanjit

28,614 downloads

28,614 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

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.