multiple environment variable in "exec" command

asked 2016-10-31 05:43:13 -0600

msroolez gravatar image

updated 2016-11-01 10:01:39 -0600

Hallo Everyone, my previous "exec" command configuration added one environment variable, but only in case the variable is declared in hiera.

exec { "my_command":
      command     => "cat /do/something",
      environment => $foo ? {
            ''      => [],
            default => "foo=${bar}",

I would like to extend this configuration and declare multiple environment variables. I would like to also check if each of them is declared in hiera. Could you please give me a hint how the syntax looks in this case?

edit retag flag offensive close merge delete