Unexpected modules deployed

Hi all,

We had a very strange issue occur last week, and I'm trying to better
understand how Foreman utilizes environments.

Our environment had already been setup with
/etc/puppet/manifest/{production,development,testing} and
/etc/puppet/modules/{production,development,testing} and had been
controlling the deployment of modules with a nodes.pp file in each manifest
directory. We installed Foreman to gain more insight and reporting. Things
were moving along just fine, with puppet deploying things properly and
Foreman graphing and reporting on all of it.

We had a nodes.pp file sitting in /etc/puppet/manifests/ from when we
initially started working with it. It contained a 'default' set that had
several testing modules in it, though up to this point none of them had
been handed out since these modules didn't exist in the root of
/etc/puppet/modules. There was an accidental copy of all of the modules
from the 'testing' directory into the root of '/etc/puppet/modules' and
puppet picked those up adn started handing them out to the 'production'

This was a surprise since we figured puppet would not hand out anything
that wasn't setup in the production, development, or testing sub
directories. We quickly removed the nodes.pp file from
/etc/puppet/manifests as well as all of the modules that we had misplaced
in /etc/puppet/modules. Now it seems that we MUST use Foreman to configure
which classes a host gets, and the nodes.pp files located under
$env/manifests seem to have no affect. We'd like to get back to how it was,
but are somewhat confused over why it behaved like this.

Any help on understanding is very appreciated. Thanks so much!

Hi Stephen,

Firsty, could you pastie (if you still have it) the puppet.conf from when
this happened? I'm assuming it had something like

modulepath = /etc/puppet/modules/production:/etc/puppet/modules

Which would be why Puppet was able to find modules in the latter path.

As for your nodes.pp, I assume you were doing something like:

manifest = /etc/puppet/manifest/production/nodes.pp

It's not well documented, but Puppet will merge a manifest file with the
ENC data it recieves from it's ENC (in this case Foreman) - if I recall
correctly, it will apply config in a "default" block, but it will ignore a
"node <foo>" block if <foo> has returned data from the ENC. This
functionality is normally used for a gradual transition to an ENC setup -
once your node is in your ENC, it will no longer get data from the manifest
file. So you're correct - once your host is in Foreman, it will get all
it's data from Foreman.

Hope that helps,

ยทยทยท On 15 July 2013 17:56, Stephen Adams wrote:

Any help on understanding is very appreciated. Thanks so much!