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.

  1. class vs define. main difference classes singletons in puppet.

  2. if want create instance of elasticsearch::instance add puppet manifest:

elasticsearch::instance { 'some_name': }

exactly same in examples.

  1. 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

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -