FAQ

On Tue, May 08, 2012 at 06:00:07AM -0400, Derek J. Balling wrote:
On May 7, 2012, at 12:47 PM, Christopher Wood wrote:
Wrapper script (similar concept for anywhere with a yaml reader):
Still have to *write* the YAML files.
I don't think I've ever actually opened a text editor and written YAML. (Tweaked, sure, but not written.) This concept is useful across any number of scripting languages:

#!/usr/bin/perl
use warnings;
use strict;
use YAML::Syck;
my %opts = (
'key1' => 'value1',
'key2' => [ 'list2a', 'list2b' ],
'key3' => { 'key3a' => 'value3a', 'key3b' => [ 'list3b1', 'list3b2' ], },
);
$YAML::Syck::SortKeys = 1;
my $yaml = Dump( \%opts );
print $yaml;

It's probably easier to think in your preferred language's data structure and then translate that to YAML. As discussed in other branches, most of our data structure requirements really aren't that complex.
Out of nosiness, how do you handle the edgier cases in your manifests? For example, how everything is a standard syslog client, except for this host which is loghost, and these couple of clients which all do different things with syslog?
We would have the syslog module have all the "common" files/packages/services/etc. declared, and then simply do something like:

if ($fqdn =~ /^syslog/)
{
..... log host specific stuff .....
}
else
{
..... NON-log host specific stuff .....
}

doesn't seem like rocket science, and makes it clear, all in one place, what's "common", and what's "special".

Puppet provides some wonderful decision-making capabilities in the manifests themselves, I've yet to see any need to have some ugly machine-readable formatted file to solve a problem.

But I *have* seen the parts of our organization that DO use Hiera complaining loudly that they can't easily figure out which of a slurry of YAML files is changing some setting/variable to a value they're not expecting.

Cheers,
D

--
You received this message because you are subscribed to the Google Groups "Puppet Users" 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-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" 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-users?hl=en.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 24 of 25 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedMay 3, '12 at 6:33p
activeMay 8, '12 at 10:01p
posts25
users13
websitepuppetlabs.com

People

Translate

site design / logo © 2023 Grokbase