[Mageia-sysadm] [1005] add the user creation by puppet
Michael Scherer
misc at zarb.org
Fri Feb 11 16:20:57 CET 2011
Le vendredi 11 février 2011 à 16:11 +0100, root at mageia.org a écrit :
> Revision: 1005
> Author: dams
> Date: 2011-02-11 16:11:00 +0100 (Fri, 11 Feb 2011)
> Log Message:
> -----------
> add the user creation by puppet
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 http://www.vim.org/scripts/script.php?script_id=978 ( yup,
self promotion )
> Modified: puppet/modules/blog/manifests/init.pp
> ===================================================================
> --- puppet/modules/blog/manifests/init.pp 2011-02-11 15:10:39 UTC (rev 1004)
> +++ puppet/modules/blog/manifests/init.pp 2011-02-11 15:11:00 UTC (rev 1005)
> @@ -1,14 +1,28 @@
> -#TODO:
> -# - add the creation of the user 'blog' in puppet
> -# - add the user 'blog' to the 'apache' group (usermod -a -G apache blog)
> class blog {
> + user { "blog":
> + groups => apache,
> + comment => "This user is used for blog.mageia.org",
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 ).
> + ensure => present,
> + managehome => true,
> + }
> +
> include apache::mod_php
> include mysql
> + apache::vhost_other_app { "blog-test.$domain":
> + vhost_file => "blog/01_blogs_vhosts.conf",
> + }
The name of templates could be IMHO be better.
> package { ['wget','php-mysql']:
> ensure => installed
> }
>
> + file { "/var/lib/blog":
> + ensure => directory,
> + owner => blog,
> + group => blog,
> + mode => 644,
> + }
> +
> file { "check_new-blog-post":
> path => "/usr/local/bin/check_new-blog-post.sh",
> ensure => present,
> @@ -18,20 +32,9 @@
> content => template("blog/check_new-blog-post.sh")
> }
>
> - apache::vhost_other_app { "blog-test.$domain":
> - vhost_file => "blog/01_blogs_vhosts.conf",
> - }
> -
> - file { "/var/lib/blog":
> - ensure => directory,
> - owner => blog,
> - group => blog,
> - mode => 644,
> - }
> -
> file { "/var/www/html/blog.mageia.org":
the naming of the directory is also hardcoded for no good reason.
> ensure => directory,
> - owner => apache,
> + owner => blog,
> group => blog,
> mode => 644,
> }
--
Michael Scherer
More information about the Mageia-sysadm
mailing list