Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to use concatenated default parameters

I have lots of parameters depending on others. Like this:

class myproject::params {
  $path       = '/'
  $path_js    = "${path}/js"

class myproject (
  $path       = $::myproject::params::path,
  $path_js    = $::myproject::params::path_js,
) inherits ::myproject::params {

If I change $path to ~/neil/myproject, $path_js keeps '/js'.

I want to retain the possibility to define $path_js separately (eq: to development files).

I want to avoid to define $path_js relative $path.

How can i achieve this behavior?