summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-sysadm/2012-April/004402.html
diff options
context:
space:
mode:
Diffstat (limited to 'zarb-ml/mageia-sysadm/2012-April/004402.html')
-rw-r--r--zarb-ml/mageia-sysadm/2012-April/004402.html142
1 files changed, 142 insertions, 0 deletions
diff --git a/zarb-ml/mageia-sysadm/2012-April/004402.html b/zarb-ml/mageia-sysadm/2012-April/004402.html
new file mode 100644
index 000000000..343f6983e
--- /dev/null
+++ b/zarb-ml/mageia-sysadm/2012-April/004402.html
@@ -0,0 +1,142 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+ <HEAD>
+ <TITLE> [Mageia-sysadm] [sysadmin-commits] [2736] do not explictely set the same value as default
+ </TITLE>
+ <LINK REL="Index" HREF="index.html" >
+ <LINK REL="made" HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5Bsysadmin-commits%5D%20%5B2736%5D%20do%20not%20explictely%20set%0A%20the%20same%20value%09as%20default&In-Reply-To=%3C1334493357.3655.47.camel%40localhost%3E">
+ <META NAME="robots" CONTENT="index,nofollow">
+ <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
+ <LINK REL="Previous" HREF="004401.html">
+ <LINK REL="Next" HREF="004403.html">
+ </HEAD>
+ <BODY BGCOLOR="#ffffff">
+ <H1>[Mageia-sysadm] [sysadmin-commits] [2736] do not explictely set the same value as default</H1>
+ <B>Michael Scherer</B>
+ <A HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5Bsysadmin-commits%5D%20%5B2736%5D%20do%20not%20explictely%20set%0A%20the%20same%20value%09as%20default&In-Reply-To=%3C1334493357.3655.47.camel%40localhost%3E"
+ TITLE="[Mageia-sysadm] [sysadmin-commits] [2736] do not explictely set the same value as default">misc at zarb.org
+ </A><BR>
+ <I>Sun Apr 15 14:35:57 CEST 2012</I>
+ <P><UL>
+ <LI>Previous message: <A HREF="004401.html">[Mageia-sysadm] [sysadmin-commits] [2736] do not explictely set the same value as default
+</A></li>
+ <LI>Next message: <A HREF="004403.html">[Mageia-sysadm] [sysadmin-commits] [2736] do not explictely set the same value as default
+</A></li>
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#4402">[ date ]</a>
+ <a href="thread.html#4402">[ thread ]</a>
+ <a href="subject.html#4402">[ subject ]</a>
+ <a href="author.html#4402">[ author ]</a>
+ </LI>
+ </UL>
+ <HR>
+<!--beginarticle-->
+<PRE>Le dimanche 15 avril 2012 &#224; 02:41 +0200, nicolas vigier a &#233;crit :
+&gt;<i> On Sun, 15 Apr 2012, <A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">root at mageia.org</A> wrote:
+</I>&gt;<i>
+</I>&gt;<i> &gt; Revision: 2736
+</I>&gt;<i> &gt; Author: misc
+</I>&gt;<i> &gt; Date: 2012-04-15 01:45:48 +0200 (Sun, 15 Apr 2012)
+</I>&gt;<i> &gt; Log Message:
+</I>&gt;<i> &gt; -----------
+</I>&gt;<i> &gt; do not explictely set the same value as default
+</I>&gt;<i>
+</I>&gt;<i> I don't see the use of not explicitely setting the values and rely on
+</I>&gt;<i> default value. Actually this make the modules unusable outside mageia
+</I>&gt;<i> servers, because default values can be different.
+</I>
+That's default in upstream puppet, so that would work almost everywhere.
+
+Package without &quot;ensure =&gt; installed&quot; are installed on all version of
+puppet.
+
+<A HREF="https://github.com/puppetlabs/puppet/blob/master/lib/puppet/type/package.rb#L113">https://github.com/puppetlabs/puppet/blob/master/lib/puppet/type/package.rb#L113</A>
+
+I have yet to see someone explicitly changing the default value.
+
+File will be root owned if nothing have been specified, since the agent
+is running as root ( and if this is not running as root as I have heard
+being done at a customer office, forcing the owner would result in a
+error, so the unusability argument can be more complex than &quot;default
+should be avoided&quot; )
+
+And ensure =&gt; present is implicit if content is set.
+
+
+&gt;<i> In my opinion we should always explicitly set the values when they are
+</I>&gt;<i> important, and only use default value when we don't care about the
+</I>&gt;<i> value.
+</I>
+
+Defaults are made to avoid endless duplication of useless source code.
+We did the same for rpm. First, every file should have had %attr, then
+it became %defattr at the beggining of %files ( I guess that was even
+before the first version of rpm ), then %defattr(-,-), then %defattr got
+removed. All of this because shorter spec without the same boilerplate
+are easier to maintain, and less tedious to write.
+
+That's just following the DRY principle.
+
+We also do not repeat file declaration from rpm to make sure that for
+example /usr/bin/svn is executable because we assume that's the default
+( and we also do not take in account in our script that it could be
+anywhere in the path ).
+We do not explicitly give the content of every config file in rpm for
+the same reason, because we assume the default are correct. So basically
+using default value is just one step further in the same direction.
+
+Out of the box reusability is nice on the paper, but in practice, this
+doesn't happen, because we do not care about portability ( like package
+name accros diverse distribution or even OS ), genericity ( service
+naming in our architecutre, like the ldap server, the prostgres one, and
+there is not even documentation about it ) or even puppet version ( we
+do no test on previous version or attempt to be compatible ), repository
+layout ( cause 1 big svn is not the most reusable way of distributing
+module, but the simplest for a infra ), etc.
+
+
+IMHO, out of the box reusability lead to complex code, and except for
+trivial service like xinetd, at or cron, people will always have to
+modify something to suit them. So in the rare event that someone decide
+that default value for package is &quot;uninstalled&quot; or something equally
+strange and this person has the same exact architecture than us except
+this detail, yes, this will not work out of the box, but in exchange of
+this sacrifice, we have shorter manifests, and less repetition.
+
+
+Taking advantage of the default is also a recommendation that I found in
+a internal audit done by puppet labs for my employer setup, the main
+idea is that it is faster to write, faster to read and understand, and
+the less code we write, the less error we can place by inadvertence.
+
+And for the sake of coherence, the whole repository was cleaned a few
+months ago to have manifests without the same boilerplate, and no one
+commented, and there is nothing special in repoctl to be different.
+--
+Michael Scherer
+
+</PRE>
+
+
+
+
+<!--endarticle-->
+ <HR>
+ <P><UL>
+ <!--threads-->
+ <LI>Previous message: <A HREF="004401.html">[Mageia-sysadm] [sysadmin-commits] [2736] do not explictely set the same value as default
+</A></li>
+ <LI>Next message: <A HREF="004403.html">[Mageia-sysadm] [sysadmin-commits] [2736] do not explictely set the same value as default
+</A></li>
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#4402">[ date ]</a>
+ <a href="thread.html#4402">[ thread ]</a>
+ <a href="subject.html#4402">[ subject ]</a>
+ <a href="author.html#4402">[ author ]</a>
+ </LI>
+ </UL>
+
+<hr>
+<a href="https://www.mageia.org/mailman/listinfo/mageia-sysadm">More information about the Mageia-sysadm
+mailing list</a><br>
+</body></html>