Hi all,
This email is seeking feedback on a proposed replacement for the
builtin node syntax in Puppet. It proposes an external node source
that will ship with Puppet, to eventually deprecate the current 'node'
construct entirely. I'm specifically seeking feedback on the following:
* Should it be part of Puppet (vs. a separate tool)?
* Is an internal DSL (see below) acceptable?
* Is there any unnecessary functionality included?
* Is any obvious or critical functionality missing?
* If you don't want to replace the current 'node' type with this, why
not?
I've been talking for more than a year about deprecating the in-
language node definitions, instead moving to some kind of external
nodes. My intention has always been to support flexibility, allowing
people to collect their information however they want, but at the same
time it's obvious that I need to provide something as simple as the
current solution.
So, I'm thinking of writing a very simple internal DSL for defining
nodes. "Internal DSL" means that the configurations would be written
in pure Ruby, rather than my writing a separate parser and lexer.
This should do two helpful things for us: It should help m get the
tool out the door that much faster, and it should make it easier for
others to enhance and extend the app.
Because the node's job is pretty simple, this DSL will be really simple.
There are (currently) only three things we need to know about a node,
other than its name:
* The classes it's a member of
* Its parameters, including facts
* Its environment
Everything else, including things like inheritance, is basically a
question of application modeling, rather than output.
My initial pass would just do everything it could to look and act like
Puppet's current nodes, with only a couple of important behaviour
exceptions.
This is more of a "what do you think?" email; there's currently no
implementation. It's simple enough that I'll probably take a day this
week and knock it out, but the intention of this email is just to
thwack the bushes a bit and see what runs out.
Here's a basic node:
node :base do
environment 'production'
self[:location] = "bna"
member_of :one, :two, :three
end
This exercises, in a minimal form, all three of the core data types:
* Set the environment to 'production'
* Set a 'location' parameter
* Declare that the node is a member of the three listed classes
All nodes would get the node's facts from Puppet as a starting point.
In the beginning, at least, this would not be configurable.
You can easily declare multiple nodes at once, and/or with parent nodes:
node :one, "two.madstop.com", "three", :inherits => :base do
...
end
At this point, I'm planning on changing the matching rules so that all
matching nodes get evaluated, because...
I'd also support regex-named nodes:
node %r{blah} do
...
end
This way, you could have multiple node declarations that added classes
or parameters or whatever based on matching the node name against a
regex.
The only other semi-significant feature I'm planning on adding is some
ability to declare that certain classes are automatic based on
parameter settings:
node :base do
autoclass :operatingsystem, :environment, :location
end
This would automatically add a class whose name is the value of the
parameter. So, if this is a production Debian machine in Nashville
(whose airport code is 'BNA' for some reason), you'd get 'production',
'debian', and 'bna' classes automatically. This works well with the
current behaviour in Puppet's external nodes, because it will
basically ignore any unknown classes returned by an external nodes app
(although some have recommended that this behaviour change).
Lastly, it would include a new executable, 'nodify', which you could
use to inspect any node at any time.
I can easily think of lots of other interesting features to add, but
this is the core to me. Specific names and terms are obviously still
subject to change, but this is close enough. I'm hoping to take some
"fun" time tonight and hack this up, including some specs laying out
the behaviours in a useful way. I'll be publishing it in my personal
repo in a branch named 'nodify'.
Before I get started, though, I'd love some feedback on the basics.
--
Anyone who considers arithmatical methods of producing random digits
is, of course, in a state of sin. --John Von Neumann
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---