Puppet Class Default Parameter/Variables -


i using custom enc , able have classes default parameters variables higher in scope.

this allows me set variable in top scope, node scope, wrapper class scope, etc , value picked default parameter class.

this allows me still set parameter @ class definition. 1 downside approach class potentially pick "unsafe" default although feel unlikely scenario.

has else looked @ solving problem such , overall idea or bad idea?

custom_enc.yaml

classes:   rsyslog::client:      port: 1234 parameters:   server: my-rsyslog-server 

manifest/server.pp

class rsyslog::client(   $server => $server,   # $server = $server || undef   $port   => $port ? {  # $port = $port || '514'     ''      => '514',     default => $port   } ) {    if !defined($server) { fail "server must defined" }    notify { "the server ${server}": }   notify { "the port ${port}": }  } 


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -