summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-sysadm/2011-July/003752.html
diff options
context:
space:
mode:
Diffstat (limited to 'zarb-ml/mageia-sysadm/2011-July/003752.html')
-rw-r--r--zarb-ml/mageia-sysadm/2011-July/003752.html216
1 files changed, 216 insertions, 0 deletions
diff --git a/zarb-ml/mageia-sysadm/2011-July/003752.html b/zarb-ml/mageia-sysadm/2011-July/003752.html
new file mode 100644
index 000000000..5f94e047a
--- /dev/null
+++ b/zarb-ml/mageia-sysadm/2011-July/003752.html
@@ -0,0 +1,216 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+ <HEAD>
+ <TITLE> [Mageia-sysadm] Questions about puppet config
+ </TITLE>
+ <LINK REL="Index" HREF="index.html" >
+ <LINK REL="made" HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20Questions%20about%20puppet%20config&In-Reply-To=%3C1410745291.775371311036840736.JavaMail.root%40spooler6-g27.priv.proxad.net%3E">
+ <META NAME="robots" CONTENT="index,nofollow">
+ <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
+ <LINK REL="Previous" HREF="003814.html">
+ <LINK REL="Next" HREF="003760.html">
+ </HEAD>
+ <BODY BGCOLOR="#ffffff">
+ <H1>[Mageia-sysadm] Questions about puppet config</H1>
+ <B>sebelee at free.fr</B>
+ <A HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20Questions%20about%20puppet%20config&In-Reply-To=%3C1410745291.775371311036840736.JavaMail.root%40spooler6-g27.priv.proxad.net%3E"
+ TITLE="[Mageia-sysadm] Questions about puppet config">sebelee at free.fr
+ </A><BR>
+ <I>Tue Jul 19 02:54:00 CEST 2011</I>
+ <P><UL>
+ <LI>Previous message: <A HREF="003814.html">[Mageia-sysadm] Puppet lockup, potential solution
+</A></li>
+ <LI>Next message: <A HREF="003760.html">[Mageia-sysadm] Questions about puppet config
+</A></li>
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#3752">[ date ]</a>
+ <a href="thread.html#3752">[ thread ]</a>
+ <a href="subject.html#3752">[ subject ]</a>
+ <a href="author.html#3752">[ author ]</a>
+ </LI>
+ </UL>
+ <HR>
+<!--beginarticle-->
+<PRE>After regarding a little bit the puppet configuration, I have some questions about the current puppet configuration.
+
+
+1) Why using both subscribe() and notify() metaparameters ?
+
+If i'm not mistaken a &quot;file resource&quot; notify a &quot;service&quot;, or a &quot;service&quot; subscribe to a &quot;file ressource&quot; : the result are already the same.
+As you say puppet is a little bit too intimidating and in order to be more easy, can we perhaps use only one method ?
+
+For example change all subscribe() calling ?
+
+-----------------------------
+modules/ntp/manifests/init.pp
+-----------------------------
+class ntp {
+
+ package { ntp:
+ ensure =&gt; installed
+ }
+
+ service { ntpd:
+ ensure =&gt; running,
+ path =&gt; &quot;/etc/init.d/ntpd&quot;,
+ }
+
+ file { &quot;ntp.conf&quot;:
+ path =&gt; &quot;/etc/ntp.conf&quot;,
+ ensure =&gt; present,
+ owner =&gt; root,
+ group =&gt; root,
+ mode =&gt; 644,
+ require =&gt; Package[&quot;ntp&quot;],
+ content =&gt; template(&quot;ntp/ntp.conf&quot;),
+ notify =&gt; Service[&quot;ntpd&quot;],
+ }
+}
+
+
+
+2) In the same idea, after reading the beginning of the book &quot;Pro Puppet&quot;, the author describes a sort of Best Pratice for managing puppet's module.
+
+The book extract :
+&lt;&lt; In Listing 2-2, we created a functional structure by dividing the components of the service we're managing into functional domains: things to be installed, things to be configured and things to be executed or run. &gt;&gt;
+
+He also split a module in 3 files and include all of them into init.pp
+- manifests/install.pp
+- manifests/config.pp
+- manifests/service.pp
+
+
+For example with the ntp service :
+
+--------------------------------
+modules/ntp/manifests/install.pp
+--------------------------------
+class ntp::install {
+ package { &quot;ntp&quot;:
+ ensure =&gt; installed
+ }
+}
+
+--------------------------------
+modules/ntp/manifests/config.pp
+--------------------------------
+class ntp::config {
+ file { &quot;ntp.conf&quot;:
+ path =&gt; &quot;/etc/ntp.conf&quot;,
+ ensure =&gt; present,
+ owner =&gt; root,
+ group =&gt; root,
+ mode =&gt; 644,
+ content =&gt; template(&quot;ntp/ntp.conf&quot;),
+ require =&gt; Class[&quot;ntp::install&quot;],
+ notify =&gt; Class[&quot;ntp::service&quot;],
+ }
+}
+
+--------------------------------
+modules/ntp/manifests/service.pp
+--------------------------------
+class ntp::service {
+ service { &quot;ntpd&quot;:
+ ensure =&gt; running,
+ path =&gt; &quot;/etc/init.d/ntpd&quot;,
+ }
+}
+
+-----------------------------
+modules/ntp/manifests/init.pp
+-----------------------------
+class ntp {
+ include ntp::install, ntp::config, ntp::service
+}
+
+
+Also we have the same logical, a &quot;config ressource&quot;
+- need a &quot;install ressource&quot; (packages)
+- and notify a &quot;service&quot;
+
+
+
+3) With this schema, we can also classify specials functionnalites or class by creating one or more extra file(s)
+
+ a) for example for the &quot;define vhost_redirect_ssl&quot; in apache module
+
+ ----------------------------------
+ modules/apache/manifests/vhosts.pp
+ ----------------------------------
+ ...
+ define apache::vhost_redirect_ssl() {
+ vhost_base { &quot;redirect_ssl_$name&quot;:
+ vhost =&gt; $name,
+ content =&gt; template(&quot;apache/vhost_ssl_redirect.conf&quot;)
+ }
+ }
+ ...
+
+
+
+ b) or for make differences between tasks, example for cronjobs
+
+ ------------------------------------
+ deployement/common/manifests/cron.pp
+ ------------------------------------
+ class common::urpmi_update {
+ cron { urpmi_update:
+ user =&gt; root,
+ hour =&gt; '*/4',
+ minute =&gt; 0,
+ command =&gt; &quot;/usr/sbin/urpmi.update -a -q&quot;,
+ }
+ }
+
+
+
+I'm just a beginner with puppet and I don't know if this a method can work for a production environnement day after day...
+But i think instead of having all the module's classes in a same file, split them into specifics items would be more easy for understanding and also give more granularity.
+
+
+What do you thing about this approach ?
+
+--
+S&#233;bastien Kurtzemann
+</PRE>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<!--endarticle-->
+ <HR>
+ <P><UL>
+ <!--threads-->
+ <LI>Previous message: <A HREF="003814.html">[Mageia-sysadm] Puppet lockup, potential solution
+</A></li>
+ <LI>Next message: <A HREF="003760.html">[Mageia-sysadm] Questions about puppet config
+</A></li>
+ <LI> <B>Messages sorted by:</B>
+ <a href="date.html#3752">[ date ]</a>
+ <a href="thread.html#3752">[ thread ]</a>
+ <a href="subject.html#3752">[ subject ]</a>
+ <a href="author.html#3752">[ 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>