Puppet elasticsearch module (class vs define) -
i trying use following elasticsearch module puppet (with hiera).
i trying configure node.name
example, can seen in instance.pp
file.
elasticsearch::instance
not class however, defined , seems used in other classes (specifically elasticsearch, in init.pp
).
i have tried instantiating class, config through like:
elasticsearch::elasticsearch::instance::node.name: 'myname'
in .yaml, no avail.
i try explain problems mentioned.
class vs define. main difference classes singletons in puppet.
if want create instance of
elasticsearch::instance
add puppet manifest:
elasticsearch::instance { 'some_name': }
exactly same in examples.
the purpose of using hiera puppet provide proper values puppet manifests depend on deployment environment. cannot create resource defining in hiera. if define resource in hiera, use create_resource function create instance. please read following article. in example, equivalent of making instance in puppet manifest:
users { 'gary': ensure => present, uid => '5001', gid => 'gary', shell => 'zsh', password => $password, }
is, following definition in hiera
#some.yaml users: gary: ensure: 'present' uid: '5001' gid: 'gary' shell: 'zsh' password: 'biglongpasswordhash'
with instantiation in puppet manifest:
$users = hiera('users') create_resources('users')
Comments
Post a Comment