From 1be510f9529cb082f802408b472a77d074b394c0 Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Sun, 14 Apr 2013 13:46:12 +0000 Subject: Add zarb MLs html archives --- zarb-ml/mageia-sysadm/2010-November/000534.html | 121 ++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 zarb-ml/mageia-sysadm/2010-November/000534.html (limited to 'zarb-ml/mageia-sysadm/2010-November/000534.html') diff --git a/zarb-ml/mageia-sysadm/2010-November/000534.html b/zarb-ml/mageia-sysadm/2010-November/000534.html new file mode 100644 index 000000000..86e759f03 --- /dev/null +++ b/zarb-ml/mageia-sysadm/2010-November/000534.html @@ -0,0 +1,121 @@ + + + + [Mageia-sysadm] Keep puppet module generic without hardcoding domain name + + + + + + + + + +

[Mageia-sysadm] Keep puppet module generic without hardcoding domain name

+ Michael Scherer + misc at zarb.org +
+ Mon Nov 15 18:03:46 CET 2010 +

+
+ +
Hi,
+
+Looking after most commits, I see that we often hardcode the domain name
+in the puppet manifest and template.
+
+I think we should avoid for various reasons :
+
+- hard coding anything is never good
+
+- if one day we fork again, or if we are forced to change project name
+( both have occurred in the past for mandriva, so maybe we could be
+proactive this time ), this would be easier for us ( or them, depending
+on the side of the fork we are ).
+
+- this greatly enhance the module reusability ( IE, I cut and past some
+module that I use on my server )
+
+- this is not really complex to achieve, thanks to templating
+
+and the more important reason :
+
+- this allow us to set up test VMs/servers without fiddling with DNS too
+much, and prevent stupid errors ( like changing /etc/hosts and
+forgetting this was changed ). 
+
+
+  
+So, if you agree with me, and if you see mageia.org in some templates
+files ( except in bind for obvious reason ), just replace this with <%=
+domain %>. See for example commit 221.
+
+This is the ERB syntax ( erb being the template engine of ruby and
+puppet ) for expanding the variable, see
+http://en.wikipedia.org/wiki/ERuby
+
+The list of variable to use can be found with the facter command.
+
+And for the ldap dc=mageia,dc=org, we can either add a variable to
+facter ( this would be cleaner, but more complex
+http://projects.puppetlabs.com/projects/1/wiki/Adding_Facts ), or use
+this in the template :
+
+<%
+dc_suffix = 'dc=' + domain.gsub('.',',dc=')
+%>
+
+<%= dc_suffix %>
+
+See commit 211 for example on how do this.
+
+
+Of course, if there is something I missed, do not hesitate to tell. 
+-- 
+Michael Scherer
+
+
+ + + + + + + + + + + + + +
+

+ +
+More information about the Mageia-sysadm +mailing list
+ -- cgit v1.2.1