1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mageia-sysadm] [1005] add the user creation by puppet
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B1005%5D%20add%20the%20user%20creation%20by%20puppet&In-Reply-To=%3C1297437657.21676.130.camel%40akroma.ephaone.org%3E">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="002725.html">
<LINK REL="Next" HREF="002727.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mageia-sysadm] [1005] add the user creation by puppet</H1>
<B>Michael Scherer</B>
<A HREF="mailto:mageia-sysadm%40mageia.org?Subject=Re%3A%20%5BMageia-sysadm%5D%20%5B1005%5D%20add%20the%20user%20creation%20by%20puppet&In-Reply-To=%3C1297437657.21676.130.camel%40akroma.ephaone.org%3E"
TITLE="[Mageia-sysadm] [1005] add the user creation by puppet">misc at zarb.org
</A><BR>
<I>Fri Feb 11 16:20:57 CET 2011</I>
<P><UL>
<LI>Previous message: <A HREF="002725.html">[Mageia-sysadm] [520] left background update (alexn83)
</A></li>
<LI>Next message: <A HREF="002727.html">[Mageia-sysadm] [1004] add a replyto for mail from bot and the user creation by puppet
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#2726">[ date ]</a>
<a href="thread.html#2726">[ thread ]</a>
<a href="subject.html#2726">[ subject ]</a>
<a href="author.html#2726">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Le vendredi 11 février 2011 à 16:11 +0100, <A HREF="https://www.mageia.org/mailman/listinfo/mageia-sysadm">root at mageia.org</A> a écrit :
><i> Revision: 1005
</I>><i> Author: dams
</I>><i> Date: 2011-02-11 16:11:00 +0100 (Fri, 11 Feb 2011)
</I>><i> Log Message:
</I>><i> -----------
</I>><i> add the user creation by puppet
</I>
The commit message do not correspond much to what happened
( ie, there was also others changes ). I do use a specific hook in vim
to have a diff when redacting the commit message to precisely avoid
this, see <A HREF="http://www.vim.org/scripts/script.php?script_id=978">http://www.vim.org/scripts/script.php?script_id=978</A> ( yup,
self promotion )
><i> Modified: puppet/modules/blog/manifests/init.pp
</I>><i> ===================================================================
</I>><i> --- puppet/modules/blog/manifests/init.pp 2011-02-11 15:10:39 UTC (rev 1004)
</I>><i> +++ puppet/modules/blog/manifests/init.pp 2011-02-11 15:11:00 UTC (rev 1005)
</I>><i> @@ -1,14 +1,28 @@
</I>><i> -#TODO:
</I>><i> -# - add the creation of the user 'blog' in puppet
</I>><i> -# - add the user 'blog' to the 'apache' group (usermod -a -G apache blog)
</I>><i> class blog {
</I>><i> + user { "blog":
</I>><i> + groups => apache,
</I>><i> + comment => "This user is used for blog.mageia.org",
</I>
This comment is not very helpful to explain the use of the user.
And as I said numerous time, I think we should try to avoid hardcoding
domain name in puppet. WHile a comment has no incidence, it just add
noise when someone want to check that nothing is hardcoded ( using
grep ).
><i> + ensure => present,
</I>><i> + managehome => true,
</I>><i> + }
</I>><i> +
</I>><i> include apache::mod_php
</I>><i> include mysql
</I>><i> + apache::vhost_other_app { "blog-test.$domain":
</I>><i> + vhost_file => "blog/01_blogs_vhosts.conf",
</I>><i> + }
</I>
The name of templates could be IMHO be better.
><i> package { ['wget','php-mysql']:
</I>><i> ensure => installed
</I>><i> }
</I>><i>
</I>><i> + file { "/var/lib/blog":
</I>><i> + ensure => directory,
</I>><i> + owner => blog,
</I>><i> + group => blog,
</I>><i> + mode => 644,
</I>><i> + }
</I>><i> +
</I>><i> file { "check_new-blog-post":
</I>><i> path => "/usr/local/bin/check_new-blog-post.sh",
</I>><i> ensure => present,
</I>><i> @@ -18,20 +32,9 @@
</I>><i> content => template("blog/check_new-blog-post.sh")
</I>><i> }
</I>><i>
</I>><i> - apache::vhost_other_app { "blog-test.$domain":
</I>><i> - vhost_file => "blog/01_blogs_vhosts.conf",
</I>><i> - }
</I>><i> -
</I>><i> - file { "/var/lib/blog":
</I>><i> - ensure => directory,
</I>><i> - owner => blog,
</I>><i> - group => blog,
</I>><i> - mode => 644,
</I>><i> - }
</I>><i> -
</I>><i> file { "/var/www/html/blog.mageia.org":
</I>the naming of the directory is also hardcoded for no good reason.
><i> ensure => directory,
</I>><i> - owner => apache,
</I>><i> + owner => blog,
</I>><i> group => blog,
</I>><i> mode => 644,
</I>><i> }
</I>
--
Michael Scherer
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="002725.html">[Mageia-sysadm] [520] left background update (alexn83)
</A></li>
<LI>Next message: <A HREF="002727.html">[Mageia-sysadm] [1004] add a replyto for mail from bot and the user creation by puppet
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#2726">[ date ]</a>
<a href="thread.html#2726">[ thread ]</a>
<a href="subject.html#2726">[ subject ]</a>
<a href="author.html#2726">[ 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>
|