[katello] Cannot assign puppet classes to host unless the classes are in a content view

Okay, so currently we use spacewalk, foreman and puppet separately to
install/manage our systems. OS installs/updates from spacewalk, foreman as
the puppet ENC, and puppet for config management. Things work fine,
foreman can import the puppet classes via the proxy and the classes can
then be assigned to hosts and host groups. With the move of Satellite
Server 6 using katello instead of spacewalk, we decided to investigate
katello.

I installed katello on a fresh CentOS 7 system without issue. Mirrored the
CentOS, EPEL, Puppetlabs repos as products and created a content view with
those products. Published it and then promoted it to a lifecycle
environment called production. I was then able to add a new host and
install the OS from foreman/katello. All great until I started looking at
puppet integration.

Our current puppet environment consists of classes/modules that don't
follow the module format of needing a metadata.json and other pieces of the
module, we just don't need that. So, needless to say, trying to import our
puppet environment as a product in katello and thus make it part of a
content view is not possible. So I then took a different tack and moved
our puppet modules manually into /etc/puppet/environments/common and
/etc/puppet/environments/production and was able to import the classes via
the foreman Configure -> Puppet Classes without an issue. If I look at the
Puppet Envrionments in foreman they are all there.

When trying to configure a Host Group, if I leave Lifecycle Environment
blank, the option of common or production is available for Puppet
Environment, and selecting one of those allows you to add puppet classes to
the group. However, even after assigning a host to that host group the
puppet classes do not show up when you edit the host nor are they used in a
puppet run on the host. If you select a Lifecycle Environment in the Host
Group, the puppet environments are no longer options, just the Content View.

Alright, with all of that preamble out of the way, here's the question. Is
there a way to use katello/foreman to manage your OS/content repos for OS
installs/upgrades, with foreman provisioning the host and installing it,
yet still have a puppet that is not managed by katello (having puppet in
content views would not work for us as we update puppet configs much more
often than OS release points) such that the external puppet can still use
foreman as it's ENC and puppet classes can be applied to hosts provisioned
in katello/foreman?

Thanks,
Bob Jones

> Okay, so currently we use spacewalk, foreman and puppet separately to
> install/manage our systems. OS installs/updates from spacewalk, foreman as
> the puppet ENC, and puppet for config management. Things work fine,
> foreman can import the puppet classes via the proxy and the classes can
> then be assigned to hosts and host groups. With the move of Satellite
> Server 6 using katello instead of spacewalk, we decided to investigate
> katello.
>
> I installed katello on a fresh CentOS 7 system without issue. Mirrored the
> CentOS, EPEL, Puppetlabs repos as products and created a content view with
> those products. Published it and then promoted it to a lifecycle
> environment called production. I was then able to add a new host and
> install the OS from foreman/katello. All great until I started looking at
> puppet integration.
>
> Our current puppet environment consists of classes/modules that don't
> follow the module format of needing a metadata.json and other pieces of the
> module, we just don't need that. So, needless to say, trying to import our
> puppet environment as a product in katello and thus make it part of a
> content view is not possible. So I then took a different tack and moved
> our puppet modules manually into /etc/puppet/environments/common and
> /etc/puppet/environments/production and was able to import the classes via
> the foreman Configure -> Puppet Classes without an issue. If I look at the
> Puppet Envrionments in foreman they are all there.
>
> When trying to configure a Host Group, if I leave Lifecycle Environment
> blank, the option of common or production is available for Puppet
> Environment, and selecting one of those allows you to add puppet classes to
> the group. However, even after assigning a host to that host group the
> puppet classes do not show up when you edit the host nor are they used in a
> puppet run on the host. If you select a Lifecycle Environment in the Host
> Group, the puppet environments are no longer options, just the Content View.
>
> Alright, with all of that preamble out of the way, here's the question. Is
> there a way to use katello/foreman to manage your OS/content repos for OS
> installs/upgrades, with foreman provisioning the host and installing it,
> yet still have a puppet that is not managed by katello (having puppet in
> content views would not work for us as we update puppet configs much more
> often than OS release points) such that the external puppet can still use
> foreman as it's ENC and puppet classes can be applied to hosts provisioned
> in katello/foreman?

There's an open issue for this in the UI:
Feature #6669: after lifecycle environment and content view are selected, default to associated puppet environment but have option to change it - Katello - Foreman

However, our default setup should configure a basemodule path like this:

basemodulepath   = /etc/puppet/environments/common:/etc/puppet/modules:/usr/share/puppet/modules

If you install your own puppet modules into
/etc/puppet/environments/common or /etc/puppet/modules, they should be
available to every content view (but it effectively limits you to only 1
global puppet environment of course).

··· On Fri, Oct 17, 2014 at 07:36:53AM -0700, Bob Jones wrote:

Thanks,
Bob Jones


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.
To post to this group, send email to 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.


Stephen Benjamin


Red Hat GmbH | http://de.redhat.com/ | Sitz: Grasbrunn
Handelsregister: Amtsgericht München, HRB 153243
Geschäftsführer: Charles Cachera, Michael Cunningham,
Michael O’Neill, Charles Peters

>
>
> There's an open issue for this in the UI:
> Feature #6669: after lifecycle environment and content view are selected, default to associated puppet environment but have option to change it - Katello - Foreman
>

So yes, that issue does seem to directly address the problem I'm describing.

> However, our default setup should configure a basemodule path like this:
>
> basemodulepath =
> /etc/puppet/environments/common:/etc/puppet/modules:/usr/share/puppet/modules
>
>

There is no such setting available in my foreman settings. There is a
modulepath in the puppet section of settings, but no basemodulepath.

If you install your own puppet modules into
> /etc/puppet/environments/common or /etc/puppet/modules, they should be
> available to every content view (but it effectively limits you to only 1
> global puppet environment of course).
>

So, I have my modules in /etc/puppet/environments/common and also have that
in my modulepath, but still do not have the option to assign any classes to
a host

Thanks again,
Bob

··· On Friday, October 17, 2014 12:10:30 PM UTC-4, Stephen Benjamin wrote:

> >
> >
> > There's an open issue for this in the UI:
> > Feature #6669: after lifecycle environment and content view are selected, default to associated puppet environment but have option to change it - Katello - Foreman
> >
>
> So yes, that issue does seem to directly address the problem I'm describing.
>
>
> > However, our default setup should configure a basemodule path like this:
> >
> > basemodulepath =
> > /etc/puppet/environments/common:/etc/puppet/modules:/usr/share/puppet/modules
> >
> >
>
> There is no such setting available in my foreman settings. There is a
> modulepath in the puppet section of settings, but no basemodulepath.

Sorry, that should be in /etc/puppet/puppet.conf

> If you install your own puppet modules into
> > /etc/puppet/environments/common or /etc/puppet/modules, they should be
> > available to every content view (but it effectively limits you to only 1
> > global puppet environment of course).
> >
>
> So, I have my modules in /etc/puppet/environments/common and also have that
> in my modulepath, but still do not have the option to assign any classes to
> a host

You'll need to go to Configure / Puppet Classes and use the "Import from
<hostname>" feature to get it to update the list of classes manually

··· On Fri, Oct 17, 2014 at 01:21:28PM -0700, Bob Jones wrote: > On Friday, October 17, 2014 12:10:30 PM UTC-4, Stephen Benjamin wrote:

Thanks again,
Bob


Stephen Benjamin


Red Hat GmbH | http://de.redhat.com/ | Sitz: Grasbrunn
Handelsregister: Amtsgericht München, HRB 153243
Geschäftsführer: Charles Cachera, Michael Cunningham,
Michael O’Neill, Charles Peters

Yeah, that didn't fix the issue either. I have both
/etc/puppet/environments/common and
/etc/puppet/environments/production/modules in the base module path and the
classes still do not show up as options to assign to a host once a
Lifecycle Environment is selected. I can import them via the proxy just
fine, and can assign them to a Host Group, but they do not even appear as
options when you edit a host.

I'm guess it's just not possible to assign a puppet class to a host if that
puppet class is not part of a content view that has been promoted to a
Lifecycle Environment, meaning katello cannot be used as the ENC for a
puppetmaster, it has to be managing the puppet content as well.

Bob

··· On Friday, October 17, 2014 4:34:02 PM UTC-4, Stephen Benjamin wrote: > > > > There is no such setting available in my foreman settings. There is a > > modulepath in the puppet section of settings, but no basemodulepath. > > Sorry, that should be in /etc/puppet/puppet.conf >

yes, it definitely doesnt work in 2015 as well :slight_smile: … can someone comment
if it's working for someon ?

··· On Tuesday, 21 October 2014 00:43:09 UTC+5:45, Bob Jones wrote: > > > On Friday, October 17, 2014 4:34:02 PM UTC-4, Stephen Benjamin wrote: >> >> >> > There is no such setting available in my foreman settings. There is a >> > modulepath in the puppet section of settings, but no basemodulepath. >> >> Sorry, that should be in /etc/puppet/puppet.conf >> > > Yeah, that didn't fix the issue either. I have both > /etc/puppet/environments/common and > /etc/puppet/environments/production/modules in the base module path and the > classes still do not show up as options to assign to a host once a > Lifecycle Environment is selected. I can import them via the proxy just > fine, and can assign them to a Host Group, but they do not even appear as > options when you edit a host. > > I'm guess it's just not possible to assign a puppet class to a host if > that puppet class is not part of a content view that has been promoted to a > Lifecycle Environment, meaning katello cannot be used as the ENC for a > puppetmaster, it has to be managing the puppet content as well. > > Bob >