Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion multi-line key/value pairs in Puppet Dashboard?

Received: by 10.216.138.42 with SMTP id z42mr47724wei.9.1332264342385;
        Tue, 20 Mar 2012 10:25:42 -0700 (PDT)
X-BeenThere: puppet-users@googlegroups.com
Received: by 10.180.85.199 with SMTP id j7ls183106wiz.3.gmail; Tue, 20 Mar
 2012 10:25:33 -0700 (PDT)
Received: by 10.180.106.42 with SMTP id gr10mr2572698wib.1.1332264333063;
        Tue, 20 Mar 2012 10:25:33 -0700 (PDT)
Received: by 10.180.106.42 with SMTP id gr10mr2572697wib.1.1332264333052;
        Tue, 20 Mar 2012 10:25:33 -0700 (PDT)
Return-Path: <ski...@skippy.net>
Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178])
        by gmr-mx.google.com with ESMTPS id ga1si7004321wib.2.2012.03.20.10.25.32
        (version=TLSv1/SSLv3 cipher=OTHER);
        Tue, 20 Mar 2012 10:25:32 -0700 (PDT)
Received-SPF: pass (google.com: domain of ski...@skippy.net designates 209.85.212.178 as permitted sender) client-ip=209.85.212.178;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ski...@skippy.net designates 209.85.212.178 as permitted sender) smtp.mail=ski...@skippy.net
Received: by mail-wi0-f178.google.com with SMTP id hq7so311985wib.7
        for <puppet-users@googlegroups.com>; Tue, 20 Mar 2012 10:25:32 -0700 (PDT)
        d=google.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type:content-transfer-encoding:x-gm-message-state;
        bh=8b7ESqg2nO/ox7fzKm9pjF/HC75bhQQ/cmxNssSzGyo=;
        b=H6mBJV81SY8CYb5ni4pY2qVqT2wLirKCxo9mXyLV8jsN5vuzwBxnu5BAJxUCKa6ggQ
         PlCN+eZ/68ySnwgR+z0eoCgFoD7qns83LUT8uAe6/y44nehUA7HZqQgLRj8kPwCKcMbs
         N3+6fzyKtC9cdSs3bzVc3+joZpHo1GAfev0qctpDzyri2YqnC96bbTXNiMWNMJGwC7DJ
         /D50RTSjEPLgcA3FBGfhDSeYbpJ9OJyyz+5RrZS4Q/imJ6QLOeJQP/RKMKkdv1LGR+tN
         fDnUbOpVUsp30Ds6w8LvCKflFE1GzsQykTfx7qqJ2cio1eoimTq+obvdgHUqP0OHE0tg
         Efhw==
MIME-Version: 1.0
Received: by 10.180.97.41 with SMTP id dx9mr30666184wib.9.1332264332341; Tue,
 20 Mar 2012 10:25:32 -0700 (PDT)
Received: by 10.180.81.103 with HTTP; Tue, 20 Mar 2012 10:25:32 -0700 (PDT)
In-Reply-To: <4F6841CF.8010...@lmax.com>
References: <CALxu18LiBEv2MhLb_n6KS-HV+rkF4ZNvuWodccrfxWZqyyH...@mail.gmail.com>
	<4F6841CF.8010...@lmax.com>
Date: Tue, 20 Mar 2012 13:25:32 -0400
Message-ID: <CALxu18+unDFbei6_b2coGTMDB157_ny0Z_aEwSS=fU2QQL5...@mail.gmail.com>
Subject: Re: [Puppet Users] multi-line key/value pairs in Puppet Dashboard?
From: Scott Merrill <ski...@skippy.net>
To: puppet-users@googlegroups.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Gm-Message-State: ALoCoQm61qgfmpTJk9k1d7DLhF8lcrT2cS0ZvrwFWoRw3txD+HubruZgC8soZE1GwrT8jc8j/Qn+

Thanks, Jeff and Luke, for the replies!

After reviewing Luke's suggestion and thinking things through a little
more, I think this is the right way to go for us. I hadn't really
considered the long-term ramifications of putting configuration
declarations in both Puppet manifests and in Dashboard. Much better to
keep all configurations in manifests under version control, and use
Dashboard to associate configurations to nodes.

Cheers,
Scott

On Tue, Mar 20, 2012 at 4:37 AM, Luke Bigum <Luke.Bi...@lmax.com> wrote:
> I can't help with your Dashboard problems, but can suggest an alternative=
 to
> file fragments that you might find easier to work with. I would use a
> Defined Type wrapped around Augeas where the $namevar of the Defined Type=
 is
> the name of the systctl.conf key. This way if you tried to turn ipv6 on a=
nd
> off at the same time you'd get a Puppet resource conflict.
>
> Something like this:
>
> define syssctl_line($value) {
> =C2=A0$sysconfig_file =3D "/etc/sysctl.conf"
> =C2=A0augeas { "set ${name} in ${sysconfig_file}":
> =C2=A0 =C2=A0context =3D> "/files${sysconfig_file}",
> =C2=A0 =C2=A0incl =C2=A0 =C2=A0=3D> "$sysconfig_file",
> =C2=A0 =C2=A0lens =C2=A0 =C2=A0=3D> "shellvars.lns",
> =C2=A0 =C2=A0changes =3D> [ "set ${name} ${value}"]
> =C2=A0}
> }
>
> And used like this:
>
> class foo {
> =C2=A0sysctl_line { "net.ipv4.ip_forward": value =3D> "0" }
> =C2=A0sysctl_line { "kernel.sysrq": value =3D> "0" }
> =C2=A0#And this would cause an error on a node...
> =C2=A0sysctl_line { "net.ipv4.ip_forward": value =3D> "1" }
>
> }
>
> On 19/03/12 19:12, Scott Merrill wrote:
>>
>> We'd like to control, among other files, /etc/sysctl.conf with Puppet.
>> We have a baseline for this file on all our servers, but frequently
>> some of our applications require additional tweaks. These tweaks are
>> generally more than a single line.
>>
>> I know that we could create a class in our module repository with the
>> necessary additions, then define that class inside Dashboard and apply
>> it to hosts as needed. That seems a little inflexible, as we'd need to
>> create a class for each app, and define inside that class the changes
>> that we need.
>>
>> I'd prefer a more extensible solution that abstracts this a bit. A
>> "sysctl-additions" class, for example, that relies upon a
>> Dashboard-defined variable that contains the additions to place into
>> the file. But how can I (easily?) add multiple lines to the Dashboard
>> variable? Or do I have to create multiple key/value pairs for each
>> line I wish to add?
>>
>> When using Puppet Dashboard, how does one easily add multiple lines to
>> a Puppet-controlled file? Or should we not be using Dashboard for
>> that?
>>
>
>
> --
> Luke Bigum
>
> Information Systems
> Ph: +44 (0) 20 3192 2520
> luke.bi...@lmax.com | http://www.lmax.com
> LMAX, Yellow Building, 1A Nicholas Road, London W11 4AN
>
>
> The information in this e-mail and any attachment is confidential and is
> intended only for the named recipient(s). The e-mail may not be disclosed=
 or
> used by any person other than the addressee, nor may it be copied in any
> way. If you are not a named recipient please notify the sender immediatel=
y
> and delete any copies of this message. Any unauthorized copying, disclosu=
re
> or distribution of the material in this e-mail is strictly forbidden. Any
> view or opinions presented are solely those of the author and do not
> necessarily represent those of the company.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=3Den.
>