diff options
author | Michael Scherer <misc@mageia.org> | 2012-01-08 18:09:18 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2012-01-08 18:09:18 +0000 |
commit | d5bff2ba89ed464d5a05f8af09677474db61aca6 (patch) | |
tree | 4b0c4aac9e9e05e8110f041fa01addae2c577553 | |
parent | 1403da52f0620a1267d867273adcb8f36d6547e9 (diff) | |
download | puppet-d5bff2ba89ed464d5a05f8af09677474db61aca6.tar puppet-d5bff2ba89ed464d5a05f8af09677474db61aca6.tar.gz puppet-d5bff2ba89ed464d5a05f8af09677474db61aca6.tar.bz2 puppet-d5bff2ba89ed464d5a05f8af09677474db61aca6.tar.xz puppet-d5bff2ba89ed464d5a05f8af09677474db61aca6.zip |
cleaning, refactoring and removal of default already set elsewhere
-rw-r--r-- | modules/planet/manifests/init.pp | 51 | ||||
-rwxr-xr-x | modules/planet/templates/backup_planet-files.sh | 2 | ||||
-rwxr-xr-x | modules/planet/templates/deploy_new-planet.sh | 2 | ||||
-rw-r--r-- | modules/planet/templates/planet_vhosts.conf | 2 |
4 files changed, 20 insertions, 37 deletions
diff --git a/modules/planet/manifests/init.pp b/modules/planet/manifests/init.pp index 2432f54c..be53444d 100644 --- a/modules/planet/manifests/init.pp +++ b/modules/planet/manifests/init.pp @@ -1,66 +1,49 @@ class planet { user { "planet": - groups => apache, - comment => "Planet Mageia", - ensure => present, - managehome => true, - home => "/var/lib/planet", + groups => apache, + comment => "Planet Mageia", + ensure => present, + managehome => true, + home => "/var/lib/planet", } - $planet_location = "/var/www/vhosts/planet.$domain" - $planet_domain = "planet.$domain" + $location = "/var/www/vhosts/planet.$domain" + $vhost = "planet.$domain" include apache::mod_php include apache::mod_deflate - apache::vhost_base { "$planet_domain": - location => $planet_location, + + apache::vhost_base { "$vhost": + location => $location, content => template('planet/planet_vhosts.conf') } - file { "deploy_new-planet": - path => "/usr/local/bin/deploy_new-planet.sh", - ensure => present, - owner => root, - group => root, - mode => 755, + local_script { "deploy_new-planet.sh": content => template("planet/deploy_new-planet.sh") } file { "$planet_location": - ensure => directory, - owner => planet, - group => apache, - mode => 644, + ensure => directory, + owner => planet, + group => apache, } - file { "index": - path => "$planet_location/index.php", - ensure => present, + file { "$planet_location/index.php": owner => planet, group => apache, mode => 755, content => template("planet/index.php") } - package { ['php-iconv']: - ensure => installed - } + package { ['php-iconv']: } class files_backup inherits base { file { "/var/lib/planet/backup": ensure => directory, - owner => root, - group => root, - mode => 644, } - file { "backup_planet-files": - path => "/usr/local/bin/backup_planet-files.sh", - ensure => present, - owner => root, - group => root, - mode => 755, + local_script { "backup_planet-files.sh": content => template("blog/backup_planet-files.sh") } diff --git a/modules/planet/templates/backup_planet-files.sh b/modules/planet/templates/backup_planet-files.sh index 1b019afd..8cab8d1e 100755 --- a/modules/planet/templates/backup_planet-files.sh +++ b/modules/planet/templates/backup_planet-files.sh @@ -11,7 +11,7 @@ do then /bin/mkdir $PATH_TO_FILE/$locale fi - rsync -aHP --delete <%= planet_location %>/$locale $PATH_TO_FILE/$locale/$locale-$COUNT + rsync -aHP --delete <%= location %>/$locale $PATH_TO_FILE/$locale/$locale-$COUNT done # Check count file to have a week of backup in the directory if [ $COUNT -ne 6 ] diff --git a/modules/planet/templates/deploy_new-planet.sh b/modules/planet/templates/deploy_new-planet.sh index eb69f9af..605fa273 100755 --- a/modules/planet/templates/deploy_new-planet.sh +++ b/modules/planet/templates/deploy_new-planet.sh @@ -2,7 +2,7 @@ # Initialization PATH_TO_FILE=${PATH_TO_FILE:-/var/lib/planet} -PATH_TO_PLANET=${PATH_TO_PLANET:-<%= planet_location %>} +PATH_TO_PLANET=${PATH_TO_PLANET:-<%= location %>} #Ask for new locale name echo -n "Locale name: " diff --git a/modules/planet/templates/planet_vhosts.conf b/modules/planet/templates/planet_vhosts.conf index 5a59e1ed..841e33cb 100644 --- a/modules/planet/templates/planet_vhosts.conf +++ b/modules/planet/templates/planet_vhosts.conf @@ -1,4 +1,4 @@ -<Directory <%= planet_location %> > +<Directory <%= location %> > Order deny,allow Allow from All AllowOverride All |