As of Puppet Camp SF, my reading of this was that we have a loop in our thinking, and that no matter what we do will seem "wrong" from some perspective. No one seemed to agree with me, so I may well be incorrect, but I have yet to see how the nodes / facts / environments / modules loop can be sorted out so that everything depends on the right thing without having additional round trips between the client and the server.
Still, that's better than what we have, that seems wrong from several perspectives. :)
Finally, for the most part, these issues are being addressed in master; we haven't been looking at making such changes in 0.25.x.
That said, I basically agree with you.
-- Markus
--You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppe...@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
I also have an external node classifier that always returns this:
---classes:- baseenvironment: oneSo our classifier always includes base, and always sets the environment.I then invoke a puppet run on a client, specifying the environment to be *different* to the classifier.Between all of these runs I delete cached client yaml info on the server. (find /var/puppet/yaml -type f -delete)# puppetd -t --environment twonotice: hardwired onenotice: //base/Notify[hardwired one]/message: defined 'message' as 'hardwired one'notice: variable twonotice: //base/Notify[variable two]/message: defined 'message' as 'variable two'notice: Finished catalog run in 0.18 seconds# cat /tmp/environment_testtwoSo we have the class being evaluated in environment "one", but the file being sourced coming from environment "two" ! And less importantly, $environment evaluates to "two".
I also have an external node classifier that always returns this:
---classes:- baseenvironment: oneSo our classifier always includes base, and always sets the environment.I then invoke a puppet run on a client, specifying the environment to be *different* to the classifier.Between all of these runs I delete cached client yaml info on the server. (find /var/puppet/yaml -type f -delete)# puppetd -t --environment twonotice: hardwired onenotice: //base/Notify[hardwired one]/message: defined 'message' as 'hardwired one'notice: variable twonotice: //base/Notify[variable two]/message: defined 'message' as 'variable two'notice: Finished catalog run in 0.18 seconds# cat /tmp/environment_testtwoSo we have the class being evaluated in environment "one", but the file being sourced coming from environment "two" ! And less importantly, $environment evaluates to "two".Hi Nigel - a while back I found out quite by accident that yaml from external node classifierparameters:- environment: testingset the puppetmaster environment to testing..maybe that's part of it? There seemed to me to be no namespace separation between the global variable '$environment' and the server's idea of which capital-E Environment a client ought to slot into.
As of Puppet Camp SF, my reading of this was that we have a loop in our thinking, and that no matter what we do will seem "wrong" from some perspective. No one seemed to agree with me, so I may well be incorrect, but I have yet to see how the nodes / facts / environments / modules loop can be sorted out so that everything depends on the right thing without having additional round trips between the client and the server.
Still, that's better than what we have, that seems wrong from several perspectives. :)
Finally, for the most part, these issues are being addressed in master; we haven't been looking at making such changes in 0.25.x.
That said, I basically agree with you.
-- Markus
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppe...@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
On Fri, May 21, 2010 at 3:11 PM, Markus Roberts <mar...@puppetlabs.com> wrote:As of Puppet Camp SF, my reading of this was that we have a loop in our thinking, and that no matter what we do will seem "wrong" from some perspective. No one seemed to agree with me, so I may well be incorrect, but I have yet to see how the nodes / facts / environments / modules loop can be sorted out so that everything depends on the right thing without having additional round trips between the client and the server.
Still, that's better than what we have, that seems wrong from several perspectives. :)
Finally, for the most part, these issues are being addressed in master; we haven't been looking at making such changes in 0.25.x.
Can we get any insight into how the situation is in master ?I'll do some testing, but I have no overall picture of how things are *intended* to work with environments in master.
Can we get any insight into how the situation is in master ?
The short answer is, "about to be fixed".On May 21, 2010, at 5:07 PM, Nigel Kersten wrote:On Fri, May 21, 2010 at 3:11 PM, Markus Roberts <mar...@puppetlabs.com> wrote:
As of Puppet Camp SF, my reading of this was that we have a loop in our thinking, and that no matter what we do will seem "wrong" from some perspective. No one seemed to agree with me, so I may well be incorrect, but I have yet to see how the nodes / facts / environments / modules loop can be sorted out so that everything depends on the right thing without having additional round trips between the client and the server.
Still, that's better than what we have, that seems wrong from several perspectives. :)
Finally, for the most part, these issues are being addressed in master; we haven't been looking at making such changes in 0.25.x.
Can we get any insight into how the situation is in master ?I'll do some testing, but I have no overall picture of how things are *intended* to work with environments in master.This is on my short list of things to fix in the next couple of days.My plan at this point is to have the external node tool be the ultimate arbiter, then facts, then server environment. If you want your external node tool to take the client's preferred environment into account, then you have to write a plugin that does this -- it's quite easy, though.
I guess we need to add one more bit that says $environment in the compile should always be set to the client's actual environment -- I don't think this happens right now (that is, it's always the fact value).
Are there any cases where this wouldn't work?
There's one potential weirdness in that the client uses the environment in the request and also passes it in the facts; they should always be the same, but it's still two sources of data.
On May 21, 2010, at 5:29 PM, Markus Roberts wrote:Urgh; I don't really care what it does right now.
Can we get any insight into how the situation is in master ?
> I'll do some testing, but I have no overall picture of how things are *intended* to work with environments in master.
I think that's the best course; there have been a number of interrelated changes aimed at specific symptoms (and there are a few more in the queue). Regardless of the specific intent of the individual patches, what we get is the combined effect of all of them working together, so that's what we ought to look at.
The generally intent is that all this should be sane / principle of least surprise in master. But to see if it actually is (or will be, with the queued changes), testing the code is our only recourse.
The questions are roughly, 1) what does it do? 2) do we like that? 3) if not, was it intentional or an unintended consequence? 4) if intentional, what was the reasoning behind the decisions? 5) if unintentional, what went wrong and how should we fix it?
Environments are about 100x more complicated than the original idea, and I think we need to focus a lot more on the 'should' than the 'does'.
--
To be positive: To be mistaken at the top of one's voice.
-- Ambrose Bierce
---------------------------------------------------------------------
Luke Kanies -|- http://puppetlabs.com -|- +1(615)594-8199
--You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppe...@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
Hmm. That's a bit tough, since every URI has the environment in it.On May 21, 2010, at 6:17 PM, Nigel Kersten wrote:
Oh, and one extra thing.
I quite strongly feel we should drop the idea of a default environment in defaults.rb, especially one hard-wired to the name "production".
I assume this is part of the changes of making the external node classifier authoritative, but we really should be able to cope with the client not passing any information whatsoever to the server regarding a desired environment.
I'll think about this as I fly to London and Ghent; maybe we'll be able to sprint on a solution at PuppetCamp.
--
If two men agree on everything, you may be sure that one of them is
doing the thinking. -- Lyndon B. Johnson
---------------------------------------------------------------------
Luke Kanies -|- http://puppetlabs.com -|- +1(615)594-8199
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppe...@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
I would like to suggest a slight variation. I think it would be better
to move the responsibility of deciding what environment to use away from
the node classifier and into a separate script. That way it would be
possible to make external_nodes a per-environment setting, instead of
just a global setting as it is now.
On 2010-05-25 13:18, Ohad Levy wrote:
On Tue, May 25, 2010 at 5:30 PM, Thomas Bellman <bel...@nsc.liu.se<mailto:bel...@nsc.liu.se>> wrote:
I would like to suggest a slight variation. I think it would be better
to move the responsibility of deciding what environment to use away from
the node classifier and into a separate script. That way it would be
possible to make external_nodes a per-environment setting, instead of
just a global setting as it is now.
I tend to disagree here, if you want your logic to be in external nodes,
you probably want to be able to define the environment too.
But, you can't have *different* external nodes script for different
environments.
On 2010-05-25 15:32, Nigel Kersten wrote:
On Tue, May 25, 2010 at 5:18 AM, Thomas Bellman <bel...@nsc.liu.seBut, you can't have *different* external nodes script for different
environments.
Sure you can. You make your master script call another different script
per environment with the same arguments as it received..
Well, yes, there are of course ways to work around many of the limitations
of Puppet. Like we can use exec resources, and inline_template() calls
for a lot of things. But that doesn't make it right...
/Bellman
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppe...@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
On Sat, May 22, 2010 at 9:03 PM, Luke Kanies <lu...@puppetlabs.com> wrote:Hmm. That's a bit tough, since every URI has the environment in it.On May 21, 2010, at 6:17 PM, Nigel Kersten wrote:
Oh, and one extra thing.
I quite strongly feel we should drop the idea of a default environment in defaults.rb, especially one hard-wired to the name "production".
I assume this is part of the changes of making the external node classifier authoritative, but we really should be able to cope with the client not passing any information whatsoever to the server regarding a desired environment.
I'll think about this as I fly to London and Ghent; maybe we'll be able to sprint on a solution at PuppetCamp.How can we possibly make the server-side node classifier authoritative without this feature?
Before I go so far as to report some bugs, I thought I'd throw this past people to see if my reasoning is correct. (rich formatted to aid in legibility).This is a little verbose, but hopefully not too much. It's easy reading. :)
This is on 0.25.4, but scanning through the changelog didn't show anything that should affect this. I'll repeat this with 0.25.5 later.
So we have the class being evaluated in environment "one", but the file being sourced coming from environment "two" ! And less importantly, $environment evaluates to "two".
[...]
This really doesn't seem right to me.... am I missing something here?I understand we have bugs around like the closed #2748 and the open #2834 but those don't seem to have caught this particular problem and they contain some incorrect info like:"Whatever is defined in the external node database will be used instead of what was passed on the command line"
On Tue, May 25, 2010 at 9:06 AM, Thomas Bellman <bel...@nsc.liu.se> wrote:On 2010-05-25 15:32, Nigel Kersten wrote:
On Tue, May 25, 2010 at 5:18 AM, Thomas Bellman <bel...@nsc.liu.seBut, you can't have *different* external nodes script for different
environments.
Sure you can. You make your master script call another different script
per environment with the same arguments as it received..
Well, yes, there are of course ways to work around many of the limitations
of Puppet. Like we can use exec resources, and inline_template() calls
for a lot of things. But that doesn't make it right...So here's my problem with this idea.If the external node classifier is to be *authoritative* for specifying the client environment, how does it make sense to have a different classifier per environment?What does having a separate classifier per environment give us exactly?
[...]On May 21, 2010, at 10:48 PM, Nigel Kersten wrote:Before I go so far as to report some bugs, I thought I'd throw this past people to see if my reasoning is correct. (rich formatted to aid in legibility).This is a little verbose, but hopefully not too much. It's easy reading. :)
This is on 0.25.4, but scanning through the changelog didn't show anything that should affect this. I'll repeat this with 0.25.5 later.So we have the class being evaluated in environment "one", but the file being sourced coming from environment "two" ! And less importantly, $environment evaluates to "two".[...]This really doesn't seem right to me.... am I missing something here?I understand we have bugs around like the closed #2748 and the open #2834 but those don't seem to have caught this particular problem and they contain some incorrect info like:"Whatever is defined in the external node database will be used instead of what was passed on the command line"Looking at this more closely, you're right - this is a larger problem.I think the main fix we need to make is that the server needs to be able to change the client's environment in a semi-permanent way. IMO, this should be done through something like (and my proposal is) an environment file, which should just contain the name of an environment. So /etc/puppet/environment would set the client's environment, and if the client received a catalog back that specified a different environment, it would write that file with the new environment's name.
Given that, the client default environment would be hard coded as something like 'production' -- so if the file is missing we still know what to use on the very first connection -- and we write the file out as soon as we get something back from the server.We could optionally add a connection to the server, where the client just asks the server for its own node information and uses that to set its environment. Maybe it does this iff the environment file is missing?
I think that connection is less important, as long as any env info the client gets from the server is permanent.Would that do most/all of the necessary work?
--A lot of people mistake a short memory for a clear conscience.
-- Doug Larson
---------------------------------------------------------------------Luke Kanies -|- http://puppetlabs.com -|- +1(615)594-8199--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppe...@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
Given that, the client default environment would be hard coded as something like 'production' -- so if the file is missing we still know what to use on the very first connection -- and we write the file out as soon as we get something back from the server.We could optionally add a connection to the server, where the client just asks the server for its own node information and uses that to set its environment. Maybe it does this iff the environment file is missing?++ This would be brilliant and is pretty much what I want.What would make it perfect would be if any existing client facts were available to the server at this same point in order for the server to make an educated decision regarding the environment, and in a more transparent manner than examining the server side fact cache for that client.
Given that, the client default environment would be hard coded as something like 'production' -- so if the file is missing we still know what to use on the very first connection -- and we write the file out as soon as we get something back from the server.We could optionally add a connection to the server, where the client just asks the server for its own node information and uses that to set its environment. Maybe it does this iff the environment file is missing?++ This would be brilliant and is pretty much what I want.What would make it perfect would be if any existing client facts were available to the server at this same point in order for the server to make an educated decision regarding the environment, and in a more transparent manner than examining the server side fact cache for that client.
By "existing client facts" I assume you mean "as shipped / default facts" as opposed to "user written facts," as the later are per environment?
And re-asking a question I had a few months back, can anyone give me a use case for the node tool using facts to determine the environment?
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppe...@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
On Tue, May 25, 2010 at 9:19 AM, Luke Kanies <lu...@puppetlabs.com> wrote:[...]On May 21, 2010, at 10:48 PM, Nigel Kersten wrote:Before I go so far as to report some bugs, I thought I'd throw this past people to see if my reasoning is correct. (rich formatted to aid in legibility).This is a little verbose, but hopefully not too much. It's easy reading. :)
This is on 0.25.4, but scanning through the changelog didn't show anything that should affect this. I'll repeat this with 0.25.5 later.So we have the class being evaluated in environment "one", but the file being sourced coming from environment "two" ! And less importantly, $environment evaluates to "two".[...]This really doesn't seem right to me.... am I missing something here?I understand we have bugs around like the closed #2748 and the open #2834 but those don't seem to have caught this particular problem and they contain some incorrect info like:"Whatever is defined in the external node database will be used instead of what was passed on the command line"Looking at this more closely, you're right - this is a larger problem.I think the main fix we need to make is that the server needs to be able to change the client's environment in a semi-permanent way. IMO, this should be done through something like (and my proposal is) an environment file, which should just contain the name of an environment. So /etc/puppet/environment would set the client's environment, and if the client received a catalog back that specified a different environment, it would write that file with the new environment's name.Does this give us anything more than we have now with shipping puppet.conf as an erb template?
I'm not quite sure what the benefits would be of having this info stored in another config file compared to our existing one? Is the move to a unified binary changing the config file situation at all?
Given that, the client default environment would be hard coded as something like 'production' -- so if the file is missing we still know what to use on the very first connection -- and we write the file out as soon as we get something back from the server.We could optionally add a connection to the server, where the client just asks the server for its own node information and uses that to set its environment. Maybe it does this iff the environment file is missing?++ This would be brilliant and is pretty much what I want.What would make it perfect would be if any existing client facts were available to the server at this same point in order for the server to make an educated decision regarding the environment, and in a more transparent manner than examining the server side fact cache for that client.
On May 25, 2010, at 11:54 AM, Nigel Kersten wrote:On Tue, May 25, 2010 at 9:19 AM, Luke Kanies <lu...@puppetlabs.com> wrote:
[...]On May 21, 2010, at 10:48 PM, Nigel Kersten wrote:Before I go so far as to report some bugs, I thought I'd throw this past people to see if my reasoning is correct. (rich formatted to aid in legibility).This is a little verbose, but hopefully not too much. It's easy reading. :)
This is on 0.25.4, but scanning through the changelog didn't show anything that should affect this. I'll repeat this with 0.25.5 later.So we have the class being evaluated in environment "one", but the file being sourced coming from environment "two" ! And less importantly, $environment evaluates to "two".[...]This really doesn't seem right to me.... am I missing something here?I understand we have bugs around like the closed #2748 and the open #2834 but those don't seem to have caught this particular problem and they contain some incorrect info like:"Whatever is defined in the external node database will be used instead of what was passed on the command line"Looking at this more closely, you're right - this is a larger problem.I think the main fix we need to make is that the server needs to be able to change the client's environment in a semi-permanent way. IMO, this should be done through something like (and my proposal is) an environment file, which should just contain the name of an environment. So /etc/puppet/environment would set the client's environment, and if the client received a catalog back that specified a different environment, it would write that file with the new environment's name.Does this give us anything more than we have now with shipping puppet.conf as an erb template?If you ship puppet.conf, it takes at least one run to take affect; this skips that extra run.
I'm not quite sure what the benefits would be of having this info stored in another config file compared to our existing one? Is the move to a unified binary changing the config file situation at all?The unified executable doesn't really affect this at all.The reason I like it to be in a different file is that the assumption would be that Puppet maintains this file rather than the user (i.e., it would generally be written to by Puppet rather than read from), which is not at all the case with puppet.conf.It's also something external tools could come to rely on.
Given that, the client default environment would be hard coded as something like 'production' -- so if the file is missing we still know what to use on the very first connection -- and we write the file out as soon as we get something back from the server.We could optionally add a connection to the server, where the client just asks the server for its own node information and uses that to set its environment. Maybe it does this iff the environment file is missing?++ This would be brilliant and is pretty much what I want.What would make it perfect would be if any existing client facts were available to the server at this same point in order for the server to make an educated decision regarding the environment, and in a more transparent manner than examining the server side fact cache for that client.Don't want much, do you? :/Given this request, my tendency for now is to skip the extra step and rely on whatever env info comes back from the catalog. We're already sending the facts along with that request, so it's not extra work.
--One of the Ten Commandments for Technicians:
(7) Work thou not on energized equipment, for if thou dost, thy
fellow workers will surely buy beers for thy widow and
console her in other ways.
---------------------------------------------------------------------Luke Kanies -|- http://puppetlabs.com -|- +1(615)594-8199
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppe...@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.