Foreman host groups in Puppet manifests?

Hi,

I'm new to Puppet and Foreman - installed both (on Ubuntu 12.04.04) and
played with a little bit.
So far I've managed Puppet and Foreman to do almost all I need for my
environment, but of course still have questions…

I need to check in Puppet manifest if the current host is assigned to a
particular Foreman host group.

I hope to have something like that in my manifest file

if $foreman_host_group == 'Generic/Physical_Server' {

… some long Puppet code…

*} else { *

… some long Puppet code…

}

Is it possible at all?

Thank you!

Evgeny

[SOLVED]

There is a $hostgroup variable and it contains Foreman hostgroup's name.

Thank you!

··· On Wednesday, June 18, 2014 10:56:47 AM UTC-7, Evgeny Vasilchenko wrote: > > Hi, > > I'm new to Puppet and Foreman - installed both (on Ubuntu 12.04.04) and > played with a little bit. > So far I've managed Puppet and Foreman to do almost all I need for my > environment, but of course still have questions... > > I need to check in Puppet manifest if the current host is assigned to a > particular Foreman host group. > > I hope to have something like that in my manifest file > > *if $foreman_host_group == 'Generic/Physical_Server' {* > > *... some long Puppet code...* > > *} else { * > > *... some long Puppet code...* > > *}* > > Is it possible at all? > > Thank you! > > Evgeny >