Hi group, is it possible to AND different facts using a case? for example: factA is "BL460c" and factB is "G6", then AND (=concat) the two arguments: case $factA.$factB: { "BL460cG1" :{ notify {"G1":} } "BL460cG6" :{ notify {"G6":} } "BL460cG7" :{ notify {"G7":} } } thanks, Stefan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
You can do: case "$factA$factB" { } Or even better, assign them to a new variable: $concatenatedFacts = "$factA$factB" case $concatenatedFacts { } Or if it makes it cleaner for your specific implementation, you may want to check $factA, then have a nested if statement to check $factB. On Feb 13, 5:43 am, Stefan Wiederoder <stefanwiedero...@googlemail.com> wrote:> Hi group, > > is it possible to AND different facts using a case? > > for example: factA is "BL460c" and factB is "G6", then AND (=concat) > the two arguments: > > case $factA.$factB: { > "BL460cG1" :{ notify {"G1":} } > "BL460cG6" :{ notify {"G6":} } > "BL460cG7" :{ notify {"G7":} } > > } > > thanks, > Stefan-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Stefan Wiederoder
2012-Feb-21 10:11 UTC
[Puppet Users] Re: question regarding case and facts
Hello Marc, thanks for your reply, I´ll give it a try. On 13 Feb., 15:24, Marc DiBlasi <marc.dibl...@gmail.com> wrote:> You can do: > case "$factA$factB" { > > } > > Or even better, assign them to a new variable: > > $concatenatedFacts = "$factA$factB" > > case $concatenatedFacts { > > } > > Or if it makes it cleaner for your specific implementation, you may > want to check $factA, then have a nested if statement to check $factB. > > On Feb 13, 5:43 am, Stefan Wiederoder > > > > > > > > <stefanwiedero...@googlemail.com> wrote: > > Hi group, > > > is it possible to AND different facts using a case? > > > for example: factA is "BL460c" and factB is "G6", then AND (=concat) > > the two arguments: > > > case $factA.$factB: { > > "BL460cG1" :{ notify {"G1":} } > > "BL460cG6" :{ notify {"G6":} } > > "BL460cG7" :{ notify {"G7":} } > > > } > > > thanks, > > Stefan-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.