Override everything by default and multiple host groups

Hello,

I'm new to Foreman.Reading some papers and watching videos made me dream
about how simply I could do things, but in reality I miss some key points
to go ahead.

1: Actually I have to toggle "override" in a class parameter to be able to
override it in a host or group section.
I need this to be the default for every variable of every class because I
will run software on a lot of different hardware that cannot have the same
defaults. How can I do that ? (I basically want to be able to do the same
thing I can do easily in hiera)

  1. I can only choose one host group for a host. I've read tons of weird
    things with using multiple groups and I really don't know why this is still
    unimplemented. I'm currently doing this with Hiera seamlessly
    ($g=hiera("groups") hiera_include("classes","",$g), you have groups support
    :slight_smile: ) and and this is a show stopper missing feature to me unless you can
    explain how I can achieve the bellow example.

For instance I want :
a "datacenter-x" group, so resolv.conf/ntp settings are different given a
datacenter x.
a "app-x-database" group so database settings can be parameterized per
application x.

So I can have

  1. a node with datacenter-1 group and app-1-database group
  2. a node with datacenter-2 group and app-1-database group
    etc…

Unless I miss something, the current system makes me create :
"datacenter-1/app-1-database" group
"datacenter-2/app-1-database" group
(or the other way but problem is the same)

And makes me repeat myself the app-1-database settings. The day I want to
change the app-1 database settings, I have to change everything for every
datacenter => no way.

Another example of weird things I've heard : 1 host is dedicated to one
role.
This is false. Demonstration :

Suppose I have a "app" class and a "database" class.
I can have a group of nodes having "app" class, and a group of nodes having
"database class".
Now I want to run app+database on the same nodes.

One would say "just create a wrapper class app+database and link it to your
nodes".
Fine, I've used a Puppet developer time when an operator should be able to
achieve this without having access to Puppet repos.

I would appreciate some explanations on these points.

If there is nothing I can do rapidly, I'll go Hiera. No interface, but
overrides everywhere and multiple groups support.

Hello,

My plan for today was to check for next version.

And you got it, config groups is exactly what I need and 1.5 is gonna be
released soon :).
So point 2 looks OK, I'll just wait for the release.

Regarding "override everything by default", is there any chance it can be a
feature for a next release ?
Most classes I use come from Puppetlabs, and they all have $params defaults.
For now, I'll just use class composition with no defaults but again, this
makes me write Puppet code while I could do without with a simple option in
the tool I use.

Thank you very much!

··· Le lundi 5 mai 2014 16:30:09 UTC+2, Vincent Miszczak a écrit : > > Hello, > > I'm new to Foreman.Reading some papers and watching videos made me dream > about how simply I could do things, but in reality I miss some key points > to go ahead. > > 1: Actually I have to toggle "override" in a class parameter to be able to > override it in a host or group section. > I need this to be the default for every variable of every class because I > will run software on a lot of different hardware that cannot have the same > defaults. How can I do that ? (I basically want to be able to do the same > thing I can do easily in hiera) > > 2. I can only choose one host group for a host. I've read tons of weird > things with using multiple groups and I really don't know why this is still > unimplemented. I'm currently doing this with Hiera seamlessly > ($g=hiera("groups") hiera_include("classes","",$g), you have groups support > :) ) and and this is a show stopper missing feature to me unless you can > explain how I can achieve the bellow example. > > For instance I want : > a "datacenter-x" group, so resolv.conf/ntp settings are different given a > datacenter x. > a "app-x-database" group so database settings can be parameterized per > application x. > > So I can have > 1. a node with datacenter-1 group and app-1-database group > 2. a node with datacenter-2 group and app-1-database group > etc... > > Unless I miss something, the current system makes me create : > "datacenter-1/app-1-database" group > "datacenter-2/app-1-database" group > (or the other way but problem is the same) > > And makes me repeat myself the app-1-database settings. The day I want to > change the app-1 database settings, I have to change everything for every > datacenter => no way. > > Another example of weird things I've heard : 1 host is dedicated to one > role. > This is false. Demonstration : > > Suppose I have a "app" class and a "database" class. > I can have a group of nodes having "app" class, and a group of nodes > having "database class". > Now I want to run app+database on the same nodes. > > One would say "just create a wrapper class app+database and link it to > your nodes". > Fine, I've used a Puppet developer time when an operator should be able to > achieve this without having access to Puppet repos. > > I would appreciate some explanations on these points. > > If there is nothing I can do rapidly, I'll go Hiera. No interface, but > overrides everywhere and multiple groups support. > >

> Hello,
>
> I'm new to Foreman.Reading some papers and watching videos made me dream
> about how simply I could do things, but in reality I miss some key
> points to go ahead.
>
> 1: Actually I have to toggle "override" in a class parameter to be able
> to override it in a host or group section.
> I need this to be the default for every variable of every class because
> I will run software on a lot of different hardware that cannot have the
> same defaults. How can I do that ? (I basically want to be able to do
> the same thing I can do easily in hiera)

If there's no default value (e.g. class foo($param) { }) then it should
override automatically. Otherwise yes, you'll need to explicitly change
this - manually, via the API etc.

> 2. I can only choose one host group for a host. I've read tons of weird
> things with using multiple groups and I really don't know why this is
> still unimplemented. I'm currently doing this with Hiera seamlessly
> ($g=hiera("groups") hiera_include("classes","",$g), you have groups
> support :slight_smile: ) and and this is a show stopper missing feature to me
> unless you can explain how I can achieve the bellow example.

Check Foreman 1.5's config groups support? There's a link to a small
demo from this month's newsletter:

··· On 05/05/14 15:30, Vincent Miszczak wrote:


Dominic Cleal
Red Hat Engineering

Hi Vincent,

I'm glad that feature will help! By all means file a feature request
for handling defaults in redmine. If it appears popular or particularly
useful, then somebody may work on it for a future release.

If you can submit a pull request then we can certainly work with you to
get that included for the next major release.

Cheers,

··· -- Dominic Cleal Red Hat Engineering

On 06/05/14 10:00, Vincent Miszczak wrote:

Hello,

My plan for today was to check for next version.

And you got it, config groups is exactly what I need and 1.5 is gonna be
released soon :).
So point 2 looks OK, I’ll just wait for the release.

Regarding “override everything by default”, is there any chance it can
be a feature for a next release ?
Most classes I use come from Puppetlabs, and they all have $params defaults.
For now, I’ll just use class composition with no defaults but again,
this makes me write Puppet code while I could do without with a simple
option in the tool I use.

Thank you very much!

Le lundi 5 mai 2014 16:30:09 UTC+2, Vincent Miszczak a écrit :

Hello,

I'm new to Foreman.Reading some papers and watching videos made me
dream about how simply I could do things, but in reality I miss some
key points to go ahead.

1: Actually I have to toggle "override" in a class parameter to be
able to override it in a host or group section.
I need this to be the default for every variable of every class
because I will run software on a lot of different hardware that
cannot have the same defaults. How can I do that ? (I basically want
to be able to do the same thing I can do easily in hiera)

2. I can only choose one host group for a host. I've read tons of
weird things with using multiple groups and I really don't know why
this is still unimplemented. I'm currently doing this with Hiera
seamlessly ($g=hiera("groups") hiera_include("classes","",$g), you
have groups support :) )  and and this is a show stopper missing
feature to me unless you can explain how I can achieve the bellow
example.

For instance I want :
a "datacenter-x" group, so resolv.conf/ntp settings are different
given a datacenter x.
a "app-x-database" group so database settings can be parameterized
per application x.

So I can have 
1. a node with datacenter-1 group and app-1-database group
2. a node with datacenter-2 group and app-1-database group
etc...

Unless I miss something, the current system makes me create :
"datacenter-1/app-1-database" group 
"datacenter-2/app-1-database" group
(or the other way but problem is the same)

And makes me repeat myself the app-1-database settings. The day I
want to change the app-1 database settings, I have to change
everything for every datacenter => no way.

Another example of weird things I've heard : 1 host is dedicated to
one role.
This is false. Demonstration :

Suppose I have a "app" class and a "database" class.
I can have a group of nodes having "app" class, and a group of nodes
having "database class".
Now I want to run app+database on the same nodes.

One would say "just create a wrapper class app+database and link it
to your nodes".
Fine, I've used a Puppet developer time when an operator should be
able to achieve this without having access to Puppet repos.

I would appreciate some explanations on these points.

If there is nothing I can do rapidly, I'll go Hiera. No interface,
but overrides everywhere and multiple groups support.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com
mailto:foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com
mailto:foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.