Hello all!
I have a "common" environment with some non-app-related modules (OS repos,
DNS, NTP, things of that nature), and several other environments, which are
application-specific - for example, "production".
Most of the common modules need to applied to all systems in "production"
environment as well, However, after importing the puppet classes into
Foreman from "common" environment, they get mapped to that environment and
I don't see a way to add any of them to any of the hostgroups from
"production" environment.
So, how do I share the modules/puppet classes between multiple environments
in Foreman?
On puppet level this should be just fine as Foreman installer puts a proper
base path for me:
grep base /etc/puppet/puppet.conf
basemodulepath =
/etc/puppet/environments/common:/etc/puppet/modules:/usr/share/puppet/modules
From Foreman/ENC point of view that should be fine as well - common modules
would get the same (global) params regardless of the environment a
particular machine is in.
How would I accomplish this?
Thanks!
Hi, I've had a similar issue since a couple of years. Every brand new
foreman/katello install I make works fine with the defined common module
path (/etc/puppet/modules/) but after I upgrade it stops working and I have
to import the classes to every environment.
I never filled a bug because I never actually investigated the reaseon, but
maybe the solution may help us both.
Regards
···
El lunes, 10 de octubre de 2016, 17:36:40 (UTC-3), Konstantin Orekhov escribió:
>
> Hello all!
>
> I have a "common" environment with some non-app-related modules (OS repos,
> DNS, NTP, things of that nature), and several other environments, which are
> application-specific - for example, "production".
> Most of the common modules need to applied to all systems in "production"
> environment as well, However, after importing the puppet classes into
> Foreman from "common" environment, they get mapped to that environment and
> I don't see a way to add any of them to any of the hostgroups from
> "production" environment.
>
> So, how do I share the modules/puppet classes between multiple
> environments in Foreman?
>
> On puppet level this should be just fine as Foreman installer puts a
> proper base path for me:
>
> # grep base /etc/puppet/puppet.conf
> basemodulepath =
> /etc/puppet/environments/common:/etc/puppet/modules:/usr/share/puppet/modules
>
> From Foreman/ENC point of view that should be fine as well - common
> modules would get the same (global) params regardless of the environment a
> particular machine is in.
>
> How would I accomplish this?
> Thanks!
>
> Hello all!
>
> I have a "common" environment with some non-app-related modules (OS
> repos, DNS, NTP, things of that nature), and several other environments,
> which are application-specific - for example, "production".
> Most of the common modules need to applied to all systems in
> "production" environment as well, However, after importing the puppet
> classes into Foreman from "common" environment, they get mapped to that
> environment and I don't see a way to add any of them to any of the
> hostgroups from "production" environment.
If they are imported into a separate environment then they are in the
wrong location. Even if they are in a "common" (basemodulepath) area
then they should appear within every other environment, not a new
environment.
> So, how do I share the modules/puppet classes between multiple
> environments in Foreman?
>
> On puppet level this should be just fine as Foreman installer puts a
> proper base path for me:
>
> # grep base /etc/puppet/puppet.conf
> basemodulepath =
> /etc/puppet/environments/common:/etc/puppet/modules:/usr/share/puppet/modules
The module should be at /etc/puppet/environments/common/ntp/ or
/etc/puppet/modules/ntp/. What are the paths of the modules you've added?
···
On 10/10/16 21:36, 'Konstantin Orekhov' via Foreman users wrote:
–
Dominic Cleal
dominic@cleal.org
>
>
> The module should be at /etc/puppet/environments/common/ntp/ or
> /etc/puppet/modules/ntp/. What are the paths of the modules you've added?
>
>
Hmm, since my common environment is a real environment, its modules are
under /etc/puppet/environments/common/modules/<module>.
The same directory structure for production environment -
/etc/puppet/environments/production/modules/<module>.
Foreman has no problems finding and importing all of my classes and modules
in all environments. It just does not allow me to assign modules from one
environment (common) to any of the hosts or HostGroups belonging to other
environment.
I can create a Config Group (since it is not environment specific) and
assign modules from any environment to it, but once that CG is applied to a
host, puppet classes from other than host's environment are greyed out.
Thanks!
Hi, Dominic!
Anything you can think of as the next steps in this situation?
···
On Tuesday, October 11, 2016 at 11:06:36 AM UTC-7, Konstantin Orekhov wrote:
>
>
>> The module should be at /etc/puppet/environments/common/ntp/ or
>> /etc/puppet/modules/ntp/. What are the paths of the modules you've added?
>>
>>
> Hmm, since my common environment is a real environment, its modules are
> under /etc/puppet/environments/common/*modules*/.
> The same directory structure for production environment -
> /etc/puppet/environments/production/*modules*/.
>
> Foreman has no problems finding and importing all of my classes and
> modules in all environments. It just does not allow me to assign modules
> from one environment (common) to any of the hosts or HostGroups belonging
> to other environment.
>
> I can create a Config Group (since it is not environment specific) and
> assign modules from any environment to it, but once that CG is applied to a
> host, puppet classes from other than host's environment are greyed out.
>
> Thanks!
>
>
> The module should be at /etc/puppet/environments/common/ntp/ or
> /etc/puppet/modules/ntp/. What are the paths of the modules you've
> added?
>
>
> Hmm, since my common environment is a real environment, its modules are
> under /etc/puppet/environments/common/modules/<module>.
This isn't the right directory, it needs to be one higher, in
/etc/puppet/environments/common/ or in /etc/puppet/modules.
> Foreman has no problems finding and importing all of my classes and
> modules in all environments. It just does not allow me to assign modules
> from one environment (common) to any of the hosts or HostGroups
> belonging to other environment.
Yes, they shouldn't be imported into an environment called common, they
should appear in every environment.
···
On 11/10/16 19:06, 'Konstantin Orekhov' via Foreman users wrote:
–
Dominic Cleal
dominic@cleal.org
Sorry for a late reply here - got distracted by other things.
Thank you very much, Dominic! This indeed solved my problem with sharing
common modules between environments.