Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Variables are immutable in puppet, you cannot change the value once it has been assigned.

I have usually seen examples where people use separate variables, and pick the value out of them later..

something like the following

class zabbix_host ( $server = $zabbix_host::params::server, ) inherits zabbix_host::params { $_server = $manufacturer == 'OpenStack Foundation' { 'true' => 'proxy2', default => 'proxy1' } # make use of the 'internal' $_server value in your code later, instead of the $server parameter }

Variables are immutable in puppet, you cannot change the value once it has been assigned.

I have usually seen examples where people use separate variables, and pick the value out of them later..

something like the following

class zabbix_host (
  $server = $zabbix_host::params::server,
) inherits zabbix_host::params {
  $_server = $manufacturer == 'OpenStack Foundation' { 'true' => 'proxy2', default => 'proxy1' }
  # make use of the 'internal' $_server value in your code later, instead of the $server parameter
}

}