Question on node groups

Hi!

I'm considering a move to Foreman and given the prior
experience with Puppet Dashboard I'm wondering what
is the established workflow around Node Groups?

In Puppet Dashboard, if I want a node to take onto an
additional role(s) all I have to do is to dynamically add
it to an existing node group. On top of that I can also
extend Node Group definition itself by adding other Node
Group definitions to its parent chain. This comes quite
handy in all sorts of situations.

In Foreman, on the other hand, it seems that Host Groups
are rather static, can only have one parent and Hosts can
only ever be part of a single Host Groups.

Am I missing something or is the model less flexible compared
to what Puppet Dashboard offers?

Thanks,
Roman.

> Hi!

Hey there :slight_smile:

> I'm considering a move to Foreman and given the prior
> experience with Puppet Dashboard I'm wondering what
> is the established workflow around Node Groups?
>
> In Puppet Dashboard, if I want a node to take onto an
> additional role(s) all I have to do is to dynamically add
> it to an existing node group. On top of that I can also
> extend Node Group definition itself by adding other Node
> Group definitions to its parent chain. This comes quite
> handy in all sorts of situations.
>
> In Foreman, on the other hand, it seems that Host Groups
> are rather static, can only have one parent and Hosts can
> only ever be part of a single Host Groups.
>
> Am I missing something or is the model less flexible compared
> to what Puppet Dashboard offers?

You are correct, the specific way Hostgroups are implemented is less
flexible than Dashboard. This is by design and has been discussed at
length by the community (search back through the archives for some
entertainment :P)

However, you can get some flexibility by using so-called wrapper
classes. Instead of Hostgroups for "Webserver", "Database", and so on;
use the Hostgroups to define the hierarchy of nodes, and classes to
implement roles. For example, I had something like:

Base
Base/Europe
Base/America
Base/Asia
Base/Australasia

as my hostgroups. Base contained obvious things like Puppet, Syslog,
SSH, etc. Each region had specific things for that region. Then my
classes would be things like:

class appserver {
include apache
include passenger
include myapp
}

I can then assign appserver to a single node, or a Hostgroup, and can
mix/match where that class goes.

It's not perfect, but it's good enough, and the other benefits Foreman
brings more than make up for it, in my opinion :slight_smile:

Hope that helps,
Greg

ยทยทยท On 12 December 2012 16:51, Roman Shaposhnik wrote: