diff options
Diffstat (limited to 'zarb-ml/mageia-sysadm/2011-July/003752.html')
-rw-r--r-- | zarb-ml/mageia-sysadm/2011-July/003752.html | 216 |
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 "file resource" notify a "service", or a "service" subscribe to a "file ressource" : 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 => installed + } + + service { ntpd: + ensure => running, + path => "/etc/init.d/ntpd", + } + + file { "ntp.conf": + path => "/etc/ntp.conf", + ensure => present, + owner => root, + group => root, + mode => 644, + require => Package["ntp"], + content => template("ntp/ntp.conf"), + notify => Service["ntpd"], + } +} + + + +2) In the same idea, after reading the beginning of the book "Pro Puppet", the author describes a sort of Best Pratice for managing puppet's module. + +The book extract : +<< 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. >> + +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 { "ntp": + ensure => installed + } +} + +-------------------------------- +modules/ntp/manifests/config.pp +-------------------------------- +class ntp::config { + file { "ntp.conf": + path => "/etc/ntp.conf", + ensure => present, + owner => root, + group => root, + mode => 644, + content => template("ntp/ntp.conf"), + require => Class["ntp::install"], + notify => Class["ntp::service"], + } +} + +-------------------------------- +modules/ntp/manifests/service.pp +-------------------------------- +class ntp::service { + service { "ntpd": + ensure => running, + path => "/etc/init.d/ntpd", + } +} + +----------------------------- +modules/ntp/manifests/init.pp +----------------------------- +class ntp { + include ntp::install, ntp::config, ntp::service +} + + +Also we have the same logical, a "config ressource" +- need a "install ressource" (packages) +- and notify a "service" + + + +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 "define vhost_redirect_ssl" in apache module + + ---------------------------------- + modules/apache/manifests/vhosts.pp + ---------------------------------- + ... + define apache::vhost_redirect_ssl() { + vhost_base { "redirect_ssl_$name": + vhost => $name, + content => template("apache/vhost_ssl_redirect.conf") + } + } + ... + + + + b) or for make differences between tasks, example for cronjobs + + ------------------------------------ + deployement/common/manifests/cron.pp + ------------------------------------ + class common::urpmi_update { + cron { urpmi_update: + user => root, + hour => '*/4', + minute => 0, + command => "/usr/sbin/urpmi.update -a -q", + } + } + + + +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é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> |