Created
July 24, 2013 15:09
-
-
Save jsoriano/6071447 to your computer and use it in GitHub Desktop.
Concatenate arrays that are parameters of resources in puppet without the use of ruby code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class foo ($concatenate = []) { | |
class simple_resource { | |
exec { 'env': | |
command => 'env | sort', | |
path => '/usr/bin', | |
environment => ['FOO=bar'], | |
logoutput => true, | |
} | |
} | |
class complex_resource($extraenv) inherits simple_resource { | |
Exec['env'] { | |
environment +> $extraenv, | |
} | |
} | |
if $concatenate { | |
class { 'complex_resource': extraenv => $concatenate } | |
} else { | |
include simple_resource | |
} | |
} | |
class { 'foo': concatenate => ['FOO2=bar', 'FOO3=sadad'] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment