Hi All,
I am writing some puppet manifests to manage some deployments. I have
created a define which takes some parameters and i am providing the
input with variables in the site.pp file. I am managing 3 different
environments like testing, staging and production and have tagged the
servers as tst_env, stg_env and prd_env for doing some customization.
However i have some common stuff to do in tst_env and stg_env
evironments, but i have to create 3 different if conditions, something
like this
if tagged(tst_env)
{
do somethng...
}
if tagged(stg_env)
{
do somethng...
}
if tagged(prd_env)
{
do somethng...
}
I would like to combine the tst_env and stg_env by using somethng like
a OR condition. Howerver the following below doesnt work.
if tagged(tst_env|stg_env)
Any ideas how do i apply the same code to 2 environments without
creating an additional if statement.
- I have 2nd query with arrays and variables
I am invoking a define by providing an array with some software
packages to be installed.
Eg:
definename::install{
[ ''package1'',
''package2'',
''package3''
]:
othervariabes ...
}
Within the define i am using the $name to parse the array and do the
stuff.
Is there a possibility that i can assign that array to a variable
before the define and use it later. It works with normal variables,
However the following below doesnt work:
Eg:
$pkglist = [ ''package1'',
''package2'',
''package3''
]:
definename::install{
$pkglist
othervariabes ...
}
- Can i also use if conditions while invoking defines?
Any inputs appreciated.
Regards,
Kevin
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.