aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Lallement <dams@mageia.org>2011-03-03 18:01:31 +0000
committerDamien Lallement <dams@mageia.org>2011-03-03 18:01:31 +0000
commit22dbd7f2a4c62033c4e49764194f7980c09488c9 (patch)
tree5f71bdeb0f2038cd9b6b043e158d0565b5ebf556
parent5e0c3274eed2b90eda66c3800d321c7f90dcfb49 (diff)
downloadpuppet-22dbd7f2a4c62033c4e49764194f7980c09488c9.tar
puppet-22dbd7f2a4c62033c4e49764194f7980c09488c9.tar.gz
puppet-22dbd7f2a4c62033c4e49764194f7980c09488c9.tar.bz2
puppet-22dbd7f2a4c62033c4e49764194f7980c09488c9.tar.xz
puppet-22dbd7f2a4c62033c4e49764194f7980c09488c9.zip
update init.pp to split script in different classes
-rw-r--r--modules/blog/manifests/init.pp90
1 files changed, 47 insertions, 43 deletions
diff --git a/modules/blog/manifests/init.pp b/modules/blog/manifests/init.pp
index 21941c91..647b868e 100644
--- a/modules/blog/manifests/init.pp
+++ b/modules/blog/manifests/init.pp
@@ -1,54 +1,58 @@
class blog {
- user { "blog":
+ class base {
+ user { "blog":
groups => apache,
comment => "Mageia Blog",
ensure => present,
managehome => true,
home => "/var/lib/blog",
+ }
}
-
- package { ['wget','php-mysql']:
- ensure => installed
- }
-
- file { "check_new-blog-post":
- path => "/usr/local/bin/check_new-blog-post.sh",
- ensure => present,
- owner => root,
- group => root,
- mode => 755,
- content => template("blog/check_new-blog-post.sh")
- }
+
+ class champagne inherits base {
+ package { ['wget','php-mysql']:
+ ensure => installed
+ }
+
+ file { "check_new-blog-post":
+ path => "/usr/local/bin/check_new-blog-post.sh",
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 755,
+ content => template("blog/check_new-blog-post.sh")
+ }
- cron { blog:
- user => blog,
- minute => '*/15',
- command => "/usr/local/bin/check_new-blog-post.sh",
- require => [File["check_new-blog-post"], User['blog']],
- }
-
- include apache::mod_php
-
- $blog_location = "/var/www/html/blog.$domain"
- $blog_domain = "blog-test.$domain"
-
- apache::vhost_base { "$blog_domain":
- location => $blog_location,
- content => template('blog/blogs_vhosts.conf'),
- }
-
- apache::vhost_base { "ssl_$blog_domain":
- use_ssl => true,
- vhost => $blog_domain,
- location => $blog_location,
- content => template('blog/blogs_vhosts.conf'),
- }
-
- file { "$blog_location":
- ensure => directory,
- owner => blog,
- group => apache,
- mode => 644,
+ cron { blog:
+ user => blog,
+ minute => '*/15',
+ command => "/usr/local/bin/check_new-blog-post.sh",
+ require => [File["check_new-blog-post"], User['blog']],
+ }
+
+ include apache::mod_php
+
+ $blog_location = "/var/www/html/blog.$domain"
+ $blog_domain = "blog-test.$domain"
+
+ apache::vhost_base { "$blog_domain":
+ location => $blog_location,
+ content => template('blog/blogs_vhosts.conf'),
+ }
+
+ apache::vhost_base { "ssl_$blog_domain":
+ use_ssl => true,
+ vhost => $blog_domain,
+ location => $blog_location,
+ content => template('blog/blogs_vhosts.conf'),
+ }
+
+ file { "$blog_location":
+ ensure => directory,
+ owner => blog,
+ group => apache,
+ mode => 644,
+ }
}
}