Hi everyone,

I use a lot of accessing a variables with

class  'my_clas' (
  String $var1,
  String $var2,
  )
  {

    $path = "$var1/$var2"

    }

After loading my_class

  class { 'my_clas':
    var1 => 'something',
    var2 => 'otherthing',
    }

than I access to those variables

  $::my_class:var1
  $::my_class:path

Is it possible to do the same with define ? For example to do something
like

define my_script (
  String $name,
  )
  {

  $script_path = "/opt/local/bin/${name}",
  }


then

  my_script { 'first':
    name => 'my_script'
    }

  cron { 'first':
    command => $my_script::first::script_path
  }

  my_script { 'second':
    name => 'my_script_second'
    }

  cron { 'second':
    command => $my_script::first_second::script_path
  }


Regards


--
Albert SHIH
Observatoire de Paris
xmpp: [email protected]
Heure local/Local time:
Tue 23 Jun 2020 12:08:05 PM CEST

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20200623101514.GA58073%40io.chezmoi.fr.

Reply via email to