On Sun, 06 Jun 2010, Douglas Garstang wrote:
> I was just doing a little research on the best way to switch over to
> external nodes. It seems like you can't use a combination of the two
> systems.

I assume that "the two systems" means (1) an external node classifier,
and (2) node {...} definitions in site.pp ir something inclided by
site.pp

> Apparently if the external node tool can't find an external
> node (because it hasn't been cut over yet), then that's a failure.
> This makes moving from 'internal' nodes to external nodes BLOODY
> difficult.

I don't understand this problem description.  When your external node
tool "can't find" a node, what does it do?  If it exits with a non-zero
status, then that's a failure.  If it prints something that's not
properly formed YAML, then that's probably a failure.  But if it prints
some properly-formatted YAML that represents an empty list of classes
and an empty list of variables, then everything should work just fine.
For example, print this (without the indentation):

    ---
    parameters: {}
    classes: []

Puppet will merge this empty list of classes and empty dictionary of
parameters with whatever it gets from relevant node{} definitions
in site.pp.

Taking that into account, here's how I'd suggest that you switch over
from having everything in node definitions to having everything in an
external node classifier.

1.  When you start, you have everything in node definitions in site.pp (or
in something included by site.pp), and (this is important) you do NOT
have a default node definition:

    node foo {
       $var = "value for node foo"
       include someclass
       include anotherclass
    }

    node bar {
       $var = "value for node bar"
       include someclass
       include a_different_class
    }

2.  Create an external node classifier that always prints the
well-formed but nearly empty YAML described above, and hook the node
classifier into puppet.conf.  Test.  At this point, you haven't cut any
nodes over to the external node classifier, but you have the ability to
cut nodes over one by one.

3.  Teach your external node classifier that, if the hostname is
foo, it should print the following YAML (without the indentation):

    ---
    parameters:
      var: "value for node foo"
    classes:
    - someclass
    - anotherclass

4.  Remove the definition of node foo from site.pp.  Test.  At this
point, you have cut node foo over from being defined in site.pp to being
defined in the external node classifier, but node bar is still defined
in site.pp.

5.  Continue cutting nodes over as fast or as slowly as you like, until
you have done them all.

> And a certain person, who shall remain nameless, seems somewhat
> detached from reality, when his response to that issue was:  "Then add
> support for a default node."

As far as I understood it, that person was pretty well attached
to reality, was talking about a default node in the external node
classifier (not in site.pp), and was giving essentially the same advice
as am giving in this message.

> Just how is that going to help? If you define a default external node,
> the error will go away, but since your internal node is now defined
> as a default external node that does nothing, any future changes to
> the internal nodes until they are cut over and going to be ignored.
> Nice... nice...

I am sorry, but I still don't see how the problem that you envisage
would arise.  I think I know what "a default external node that does
nothing" is (it's basically the almost-empty YAML that I mentioned
above), but I don't know how or why you'd have an internal node
definition that referred to the empty external node definition, and I
don't know why you think future changes to node definitions in site.pp
would be ignored.  Please explain your concerns (or the results of your
expsriments) in more detail.

--apb (Alan Barrett)

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

Reply via email to