3 ms·
Well, it's of course all subjective, but I can present my perception of both (elegance vs hack) in a single pastie: http://pastie.org/2668110 http://pastie.org/
by moe 15y ago
Well, it's of course all subjective, but I can present my perception of both (elegance vs hack) in a single pastie: http://pastie.org/2668110 http://pastie.org/2668110
This will assemble a hosts-file that contains all hosts from $group, on the hosts that include the class.
It's awesome and terrible at the same time because it demonstrates an Exported Resource (@@host, Host <<| |>>, awesome) and at the same time it shows how we had to resort to extdata for grouping (extlookup = terrible) and how opaque the puppet DSL is to the uninitiated.
- snprbob86 15y agoI have no idea how to begin to read that... How is this better than something like this: gen-hosts config-file > /etc/hosts ? See this gist I just made: https://gist.github.com/1274379 https://gist.github.com/1274379 That script is (1) more understandable to a programmer, (2) unambiguous with respect to output, (3) idempotent, (4) super extensible. I suspect your Puppet script is doing some other stuff, but I can't begin to mentally parse it... EDIT: Just wanted to point out that I didn't try to make that script either correct or identical to your script. Just wanted to give an impression of the flow of things.
- moe 15y agoWell, scripts like yours go a long a way. The problem is that at some point you'll want more integration and at that point you can either go with puppet/chef - or you'll end up re-inventing them.
- snprbob86 15y agoMore integration with what? What would I be reinventing? Again, I'm genuinely ignorant in this department. Really curious what I'm not understanding, but I just get the feeling that "worse is better" here.