Puppet Integration into foreman

Newb questions warning!

Since I am so new to foreman and puppet I have some very basic question you
jedi's can answer.

1- Trying to understand how foreman creates or even can see puppet modules
if there are no manifest files anywhere. I am taking it the is because of
a database backend in foreman and you make your puppet server use the same
database? How do you create a class or module with no manifest?

2- Also I am running an ESXi test box and want puppet (once configured) to
manage a test vm on it. How can you add a vm on an ESXi server if ESXi is
not a supported compute resource? I do not need foreman to provision just
pxe boot, kickstart, puppet takes over. Is there clear steps for this in
foreman?

My setup of foreman is as follows:

Running on an ESXi VM
Centos 6.3
Using mysql as database backend for foreman
phpmyadmin installed so I can browse mysql database
foreman-proxy installed on this VM
It is the Puppet Master, CA, and Foreman server

Loving Foreman just need better docs on process for the newbs. I will be
documenting this process and cotrib to the wiki or where ever you would
prefer.

Thanks,

Dominic

> Newb questions warning!

No problem, welcome to the community! :slight_smile:

> 1- Trying to understand how foreman creates or even can see puppet modules
> if there are no manifest files anywhere. I am taking it the is because of a
> database backend in foreman and you make your puppet server use the same
> database? How do you create a class or module with no manifest?

A couple of points here. Firstly, I generally recommend against the db
sharing - give Foreman it's own database, and in the long run, you'll
be glad you did.

Foreman doesn't create any puppet code at all - it simply reads it.
So, you have to go and write some puppet code, and you have to write
it as modules - Foreman won't read site.pp or similar files.

Once you have some modules, you can ask Foreman to import your class
definitions (More -> Puppet Classes -> Import From <proxy name>).
You'll need an appropriately configured Foreman-Proxy for this. Once
your classes are imported from your puppetmaster, you'll be able to
assign the classes to nodes in the Foreman interface.

> 2- Also I am running an ESXi test box and want puppet (once configured) to
> manage a test vm on it. How can you add a vm on an ESXi server if ESXi is
> not a supported compute resource? I do not need foreman to provision just
> pxe boot, kickstart, puppet takes over. Is there clear steps for this in
> foreman?

If I recall correctly, ESXi is supported by the libvirt libraries? If
so, try setting that up, and use a Libvirt Compute Resource. I'm no
VMware expert, so other community members might chime in here.

If all else fails, create VMs by hand and treat them as Bare Metal
machines in Foreman.

> documenting this process and cotrib to the wiki or where ever you would
> prefer.

There's a new site with new docs coming soon, but in the meantime, we
always love more contributions! Please feel free to contribute to the
wiki, if that's something you want to do.

Regards,
Greg

··· On 30 November 2012 13:49, Dominic Kaiser wrote:

>> Newb questions warning!
>
> No problem, welcome to the community! :slight_smile:
>
>> 1- Trying to understand how foreman creates or even can see puppet modules
>> if there are no manifest files anywhere. I am taking it the is because of a
>> database backend in foreman and you make your puppet server use the same
>> database? How do you create a class or module with no manifest?
>
> A couple of points here. Firstly, I generally recommend against the db
> sharing - give Foreman it's own database, and in the long run, you'll
> be glad you did.
>
> Foreman doesn't create any puppet code at all - it simply reads it.
> So, you have to go and write some puppet code, and you have to write
> it as modules - Foreman won't read site.pp or similar files.
>
> Once you have some modules, you can ask Foreman to import your class
> definitions (More -> Puppet Classes -> Import From <proxy name>).
> You'll need an appropriately configured Foreman-Proxy for this. Once
> your classes are imported from your puppetmaster, you'll be able to
> assign the classes to nodes in the Foreman interface.
>
>> 2- Also I am running an ESXi test box and want puppet (once configured) to
>> manage a test vm on it. How can you add a vm on an ESXi server if ESXi is
>> not a supported compute resource? I do not need foreman to provision just
>> pxe boot, kickstart, puppet takes over. Is there clear steps for this in
>> foreman?
>
> If I recall correctly, ESXi is supported by the libvirt libraries? If
> so, try setting that up, and use a Libvirt Compute Resource. I'm no
> VMware expert, so other community members might chime in here.

VMWare support is no longer done through libvirt, as there is now a
native VMWare compute resource type. (via a vmware fog provider)
However it is currently still considered experimental and has some
restrictions that we are working on improving. I think we are a couple
weeks away from improving the support enough to remove the
experimental tag. Today it's useable to a a large degree in the
development branch, but if you are looking for VMWare support in a
stable release, I'd wait for the upcoming 1.1 release. (It's coming
very soon.)

> If all else fails, create VMs by hand and treat them as Bare Metal
> machines in Foreman.

This works great, and you get the benefits of using Foreman as a
Puppet ENC, Puppet reports processor, and systems inventory database
without the provisioning. This is ok because Foreman is really the
best option for an ENC/reports-processor today. (My company started
using foreman for these features, and are only justnow getting around
to using it for provisioning.)

Please understand compute resources are an optional piece in foreman,
and are strictly related to provisioning.

>> documenting this process and cotrib to the wiki or where ever you would
>> prefer.
>
> There's a new site with new docs coming soon, but in the meantime, we
> always love more contributions! Please feel free to contribute to the
> wiki, if that's something you want to do.

Feel free to subscribe to the foreman-dev mailing list, and/or swing
by and visit on irc #theforeman (freenode) or #theforeman-dev and say
hello!!. I'm guessing once you get a basic foreman install up, you
would be a good candidate to help out with the vmware efforts?

As for the vmware setup instructions… I believe the process today
requires you connect via a vcenter management host. Guessing if you
have a single test box, you don't have that? (It's a rapidly moving
target in the develop branch, so the docs will prolly follow once it
is released in a stable point release, which again should be fairly
soon)

··· On Fri, Nov 30, 2012 at 9:01 AM, Greg Sutcliffe wrote: > On 30 November 2012 13:49, Dominic Kaiser wrote:

Regards,
Greg


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.

Thanks for the response,

Once you have some modules, you can ask Foreman to import your class
definitions (More -> Puppet Classes -> Import From <proxy name>).
You'll need an appropriately configured Foreman-Proxy for this. Once
your classes are imported from your puppetmaster, you'll be able to
assign the classes to nodes in the Foreman interface.

So correct me if I am wrong are modules in puppet also classes? Where is
foreman pulling info from in puppet? My modules/classes are in
/usr/share/puppet/modules.

Let me know what you think,

dk

··· On Fri, Nov 30, 2012 at 9:01 AM, Greg Sutcliffe wrote:

On 30 November 2012 13:49, Dominic Kaiser dkudos@gmail.com wrote:

Newb questions warning!

No problem, welcome to the community! :slight_smile:

1- Trying to understand how foreman creates or even can see puppet
modules
if there are no manifest files anywhere. I am taking it the is because
of a
database backend in foreman and you make your puppet server use the same
database? How do you create a class or module with no manifest?

A couple of points here. Firstly, I generally recommend against the db
sharing - give Foreman it’s own database, and in the long run, you’ll
be glad you did.

Foreman doesn’t create any puppet code at all - it simply reads it.
So, you have to go and write some puppet code, and you have to write
it as modules - Foreman won’t read site.pp or similar files.

Once you have some modules, you can ask Foreman to import your class
definitions (More -> Puppet Classes -> Import From ).
You’ll need an appropriately configured Foreman-Proxy for this. Once
your classes are imported from your puppetmaster, you’ll be able to
assign the classes to nodes in the Foreman interface.

2- Also I am running an ESXi test box and want puppet (once configured)
to
manage a test vm on it. How can you add a vm on an ESXi server if ESXi
is
not a supported compute resource? I do not need foreman to provision
just
pxe boot, kickstart, puppet takes over. Is there clear steps for this in
foreman?

If I recall correctly, ESXi is supported by the libvirt libraries? If
so, try setting that up, and use a Libvirt Compute Resource. I’m no
VMware expert, so other community members might chime in here.

If all else fails, create VMs by hand and treat them as Bare Metal
machines in Foreman.

documenting this process and cotrib to the wiki or where ever you would
prefer.

There’s a new site with new docs coming soon, but in the meantime, we
always love more contributions! Please feel free to contribute to the
wiki, if that’s something you want to do.

Regards,
Greg


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.

Greg,

I thought the purpose for sharing databases is to make foreman access
Puppet Facts if you are using Storeconfigs. I there a better way to do this?

http://theforeman.org/projects/foreman/wiki/Puppet_Facts#If-You-Are-Using-Puppet-Storeconfigs

··· On Friday, November 30, 2012 9:01:02 AM UTC-5, Greg Sutcliffe wrote: > > On 30 November 2012 13:49, Dominic Kaiser <dku...@gmail.com > > wrote: > > Newb questions warning! > > No problem, welcome to the community! :) > > > 1- Trying to understand how foreman creates or even can see puppet > modules > > if there are no manifest files anywhere. I am taking it the is because > of a > > database backend in foreman and you make your puppet server use the same > > database? How do you create a class or module with no manifest? > > A couple of points here. Firstly, I generally recommend against the db > sharing - give Foreman it's own database, and in the long run, you'll > be glad you did. > > Foreman doesn't create any puppet code at all - it simply reads it. > So, you have to go and write some puppet code, and you have to write > it as modules - Foreman won't read site.pp or similar files. > > Once you have some modules, you can ask Foreman to import your class > definitions (More -> Puppet Classes -> Import From ). > You'll need an appropriately configured Foreman-Proxy for this. Once > your classes are imported from your puppetmaster, you'll be able to > assign the classes to nodes in the Foreman interface. > > > 2- Also I am running an ESXi test box and want puppet (once configured) > to > > manage a test vm on it. How can you add a vm on an ESXi server if ESXi > is > > not a supported compute resource? I do not need foreman to provision > just > > pxe boot, kickstart, puppet takes over. Is there clear steps for this > in > > foreman? > > If I recall correctly, ESXi is supported by the libvirt libraries? If > so, try setting that up, and use a Libvirt Compute Resource. I'm no > VMware expert, so other community members might chime in here. > > If all else fails, create VMs by hand and treat them as Bare Metal > machines in Foreman. > > > documenting this process and cotrib to the wiki or where ever you would > > prefer. > > There's a new site with new docs coming soon, but in the meantime, we > always love more contributions! Please feel free to contribute to the > wiki, if that's something you want to do. > > Regards, > Greg >

Foreman uses a foreman-proxy to read your puppet config file (usually
/etc/puppet/puppet.conf). In there you'll have something like
"modulepath = /usr/share/puppet/modules" so the proxy can parse that
and go look in the specified directory. It then reads all the .pp
files in each of the modules and parses them. The UI will display the
results of this operation, and allow you to confirm the import before
it happens.

If you've not already configured a foreman-proxy on your puppetmaster,
you will need one (even if it's on the same box as foreman). Check the
wiki for installation instructions.

You can, but in my opinion it's brittle, as it makes Foreman
dependant on the Puppetlabs db schema not changing. We've had a
variety of bug reports that only occur in this situation.

The current ENC script deals with fact upload to Foreman, so there's
little benefit to the db sharing any more. The only situation where
you might need to do a little more work would be if you're only using
Foreman for Reporting, and thus not using the ENC script.

Hope that clarifies a bit :slight_smile:

··· On 1 December 2012 12:25, Rodrique Heron wrote: > Greg, > > I thought the purpose for sharing databases is to make foreman access Puppet > Facts if you are using Storeconfigs. I there a better way to do this?

Thanks Greg for your response. this is helpful. Does Forman decide with
smart variables how to use the module? In other words tell the module what
to do. Does Forman write this to some sort of configfile or the db?

Thanks lots of questions,

Dominic

··· On Dec 1, 2012 5:46 AM, "Greg Sutcliffe" wrote:

Foreman uses a foreman-proxy to read your puppet config file (usually
/etc/puppet/puppet.conf). In there you’ll have something like
"modulepath = /usr/share/puppet/modules" so the proxy can parse that
and go look in the specified directory. It then reads all the .pp
files in each of the modules and parses them. The UI will display the
results of this operation, and allow you to confirm the import before
it happens.

If you’ve not already configured a foreman-proxy on your puppetmaster,
you will need one (even if it’s on the same box as foreman). Check the
wiki for installation instructions.


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.

If you're talking about parameterized classes, support for that is
only in the latest development version of Foreman. We hope to have a
release candidate out this week :slight_smile:

··· On 1 December 2012 13:03, Dominic Kaiser wrote: > Thanks Greg for your response. this is helpful. Does Forman decide with > smart variables how to use the module? In other words tell the module what > to do. Does Forman write this to some sort of configfile or the db?

ok I have managed to get foreman-proxy to pull in modules. So now do smart
variables tell the class/module what to do? That is by defining how to
instruct the module to do some action? Or is that still called in puppet
manifest?

dominic

··· On Dec 2, 2012 6:50 AM, "Greg Sutcliffe" wrote:

On 1 December 2012 12:25, Rodrique Heron swygue@gmail.com wrote:

Greg,

I thought the purpose for sharing databases is to make foreman access
Puppet
Facts if you are using Storeconfigs. I there a better way to do this?

You can, but in my opinion it’s brittle, as it makes Foreman
dependant on the Puppetlabs db schema not changing. We’ve had a
variety of bug reports that only occur in this situation.

The current ENC script deals with fact upload to Foreman, so there’s
little benefit to the db sharing any more. The only situation where
you might need to do a little more work would be if you’re only using
Foreman for Reporting, and thus not using the ENC script.

Hope that clarifies a bit :slight_smile:


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.