This module allowd you to share data with other nodes instead iof only exporting resources.
share_data { $fqdn:
data => [ $hostname, $ipaddress ],
label => 'foobar',
}
$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
Used to ship data to the master.
-
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
-
label
The label used to mark the data you want to retrieve. This function will return an
Array
of matchingshare_data
items.