Environment and enc vs client configuration

Hi, I'm running foreman 0.3.1 and puppet-2.6.6

and would like to have the ENC as authoritatively setting the
environments of the clients.

Because of http://projects.puppetlabs.com/issues/3910 it is of course
necessary to also

environment = <%= environment %> in the client's puppet.conf files.

For me the problem is that when the templates are generated the
environment setting from the ENC (foreman) is overridden by the puppet
internal fact that is collected
from the client.
In other words changing the ENC setting makes no difference since the
client is still stuck on it's own configuration and this is what ends
up in the templates.

I've read some of the recent threads and I realize that foreman-0.4 has some
updates in this area, i.e Bug #636: Foreman doews not recognise a change in the environment when this is changed in a fact - Foreman but i don't think
it will help my case since you still have to persuade the client to reconfigure
to new environment.

To elusively get the environment from foreman into my templates I was
hoping to do something like the following with foreman's function.

$encnviro = foreman("environment","name = $fqdn")

and then use that in the puppet.conf template… But it is not obvious
to me that the environment per host can be queried from foreman?

Open to suggestions, many thanks.

Steve.

(Other this environment confusion we migrated successfully from files to
foreman so thanks for the previous comments. )

··· -- Steve Traylen

> Hi, I'm running foreman 0.3.1 and puppet-2.6.6
>
> and would like to have the ENC as authoritatively setting the
> environments of the clients.
>
> Because of http://projects.puppetlabs.com/issues/3910 it is of course
> necessary to also
>
> environment = <%= environment %> in the client's puppet.conf files.
>
> For me the problem is that when the templates are generated the
> environment setting from the ENC (foreman) is overridden by the puppet
> internal fact that is collected
> from the client.
> In other words changing the ENC setting makes no difference since the
> client is still stuck on it's own configuration and this is what ends
> up in the templates.
>
> I've read some of the recent threads and I realize that foreman-0.4 has some
> updates in this area, i.e Bug #636: Foreman doews not recognise a change in the environment when this is changed in a fact - Foreman but i don't think
> it will help my case since you still have to persuade the client to reconfigure
> to new environment.
>
> To elusively get the environment from foreman into my templates I was
> hoping to do something like the following with foreman's function.
>
> $encnviro = foreman("environment","name = $fqdn")
>
> and then use that in the puppet.conf template… But it is not obvious
> to me that the environment per host can be queried from foreman?
>
> Open to suggestions, many thanks.
>
> Steve.
>
> (Other this environment confusion we migrated successfully from files to
> foreman so thanks for the previous comments. )
0.4 now has a few extra enc attributes, for example:
foreman_env: production

so you can simply use foreman_env in your templates.

hope this helps.

Ohad

··· On Wed, Oct 26, 2011 at 11:50 AM, Steve Traylen wrote: > > > > -- > Steve Traylen > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en. > >

That's very perfect, thankyou.

Steve.

··· On Wed, Oct 26, 2011 at 11:56 AM, Ohad Levy wrote: > 0.4 now has a few extra enc attributes, for example: > foreman_env: production > > so you can simply use foreman_env in your templates.


Steve Traylen