Behavior of Environments -- Bug?

2 views
Skip to first unread message

Paul Lathrop

unread,
Mar 22, 2010, 1:27:31 PM3/22/10
to puppet...@googlegroups.com
Over the weekend we noticed an interesting and unexpected behavior
with environments. I made a change to the way our puppet.conf file is
generated and distributed, which led to an environment which had been
defined on a puppetmaster being no longer defined in puppet.conf.
We'll call this the "core" environement. When clients checked in and
asked for the "core" environment, the puppetmaster didn't know about
it. I would have expected an error at this point. However, what
happened instead was the puppetmaster passed out the configs for the
"production" environment without complaint.

IMHO this is a bug, but I can see how it might be by design. Any
comments? Should I file it?

--Paul

Tony G.

unread,
Mar 22, 2010, 1:59:39 PM3/22/10
to puppet...@googlegroups.com
Hi Paul,

How does your config file look like in the main section?

There is a default one if no environment is defined, e.g.

environments = production,testing,development
manifest = /opt/puppet/production/site.pp          <-- These are the
modulepath = /opt/puppet/production/modules  <-- default locations


[production]
    manifest = /opt/puppet/production/site.pp
    modulepath = /opt/puppet/production/modules

[testing]
    manifest = /opt/puppet/testing/site.pp
    modulepath = /opt/puppet/testing/modules

[development]
    manifest = /opt/puppet/development/site.pp
    modulepath = /opt/puppet/development/modules



--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.




--
Tony

Paul Lathrop

unread,
Mar 22, 2010, 2:14:03 PM3/22/10
to puppet...@googlegroups.com
Tony,

Sure, I understand that, but if the client is asking for a specific
environment that the puppetmaster doesn't know about, I feel like that
warrants a warning at minimum, probably an error and a refusal to
compile. Would be interested if anyone has a counter-argument.

--Paul

Tony G.

unread,
Mar 22, 2010, 2:26:09 PM3/22/10
to puppet...@googlegroups.com
Oh Ok, so what you are looking for is more like a feature to let you know that the environment "foo" does not exist.

Does not sounds bad to me, if somebody uses tons of environments it will reduce errors or at least will be easier to find them.

Scott Smith

unread,
Mar 22, 2010, 2:50:58 PM3/22/10
to puppet...@googlegroups.com
On 3/22/10 10:27 AM, Paul Lathrop wrote:
> IMHO this is a bug, but I can see how it might be by design. Any
> comments? Should I file it?
>
> --Paul
>

Don't know if it's a bug but... Yeah it defaults to "production" - you have to create an empty
manifest for "production" in order to prevent Very Scary Things from occuring if you happen to also
have a "production" Puppet env.

-scott

Paul Lathrop

unread,
Mar 22, 2010, 4:26:32 PM3/22/10
to puppet...@googlegroups.com
Scott,

I know it defaults to production if a environment is not specified.
However, that's not the case here. The client *is* specifying an
environment, the server doesn't know about that environment. I think
this is different than what you are describing - if the client does
not specify an environment, it is totally sane/correct to pass out the
"production" manifests. However, if the client specifies an
environment the server doesn't know about, isn't it at least worth
warning about?

--Paul

Julian Simpson

unread,
Mar 22, 2010, 5:24:54 PM3/22/10
to puppet...@googlegroups.com
I'd expect it to fail in such a way that the puppet run could not happen. Anything else could have worse consequences.

J.
--
Julian Simpson
Software Build and Deployment
http://www.build-doctor.com
http://twitter.com/builddoctor

Nigel Kersten

unread,
Mar 22, 2010, 5:27:20 PM3/22/10
to puppet...@googlegroups.com
On Mon, Mar 22, 2010 at 2:24 PM, Julian Simpson <simpso...@gmail.com> wrote:
> I'd expect it to fail in such a way that the puppet run could not happen.
> Anything else could have worse consequences.

++

--
nigel

James Turnbull

unread,
Mar 22, 2010, 6:08:01 PM3/22/10
to puppet...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 23/03/10 7:26 AM, Paul Lathrop wrote:
> Scott,
>
> I know it defaults to production if a environment is not specified.
> However, that's not the case here. The client *is* specifying an
> environment, the server doesn't know about that environment. I think
> this is different than what you are describing - if the client does
> not specify an environment, it is totally sane/correct to pass out the
> "production" manifests. However, if the client specifies an
> environment the server doesn't know about, isn't it at least worth
> warning about?

+1. Should fail with an appropriate warning. Smells like a bug to me.

Regards

James Turnbull

- --
Author of:
* Pro Linux System Administration (http://tinyurl.com/linuxadmin)
* Pulling Strings with Puppet (http://tinyurl.com/pupbook)
* Pro Nagios 2.0 (http://tinyurl.com/pronagios)
* Hardening Linux (http://tinyurl.com/hardeninglinux)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEVAwUBS6fqQSFa/lDkFHAyAQJAGwf8D9RJMkCESZrkS9sBUKXaER+Sj0DzhK7R
LUzUc1LL2boKjzAaCHJ86fM2kwSoFBAr/rD5hbCtMAhfP5o0tRo79X+evOLK+kPK
jpk3aHL0sPpSGfUq9l5KaoumlNAZixYZZ9e38BkuLiYlwNfavVwxmN1os7Uhst96
UuI2GhXHwlDD+Nhu5b9QAomd2RArO91ujm1IC2cV3/kkfJ9UKvY121+Gt7QBSRas
tmlMofj6g7kgs8HCD76X9BQAm0Ee97H72Klz1jUckhtYnpmgpnZDlnlms9ulM/Ea
IBiUp2B3cRfgapOziEMSG6+z+ZKv9HFbGaa8s1SsxUMKlb7J7/1xUg==
=bMU4
-----END PGP SIGNATURE-----

Scott Smith

unread,
Mar 22, 2010, 9:25:54 PM3/22/10
to puppet...@googlegroups.com
On 3/22/10 1:26 PM, Paul Lathrop wrote:
> Scott,
>
> I know it defaults to production if a environment is not specified.
> However, that's not the case here. The client *is* specifying an
> environment, the server doesn't know about that environment. I think
> this is different than what you are describing - if the client does
> not specify an environment, it is totally sane/correct to pass out the
> "production" manifests. However, if the client specifies an
> environment the server doesn't know about, isn't it at least worth
> warning about?

Yeah, sorry--I was not clear in my agreement that it should probably behave differently. I did
understand your problem and have observed it myself. The work around is to not use "production" and
make it a stubbed environment with no real manifest.

But yeah, +1 on wishing to see different behavior.

-scott

Nigel Kersten

unread,
Mar 22, 2010, 9:31:30 PM3/22/10
to puppet...@googlegroups.com

I have a 'noop' environment I default to, which logs to the server
that someone has hit it, and I'm planning to monitor counts of that
when I get around to it...

>
> But yeah, +1 on wishing to see different behavior.
>
> -scott
>

> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>

--
nigel

Reply all
Reply to author
Forward
0 new messages