Commit 8c24ee75 authored by mh's avatar mh
Browse files

use a define to streamline how the scripts are deployed

parent 9dae0f5c
......@@ -24,48 +24,14 @@ class webhosting::user_scripts {
}
# script to adjust permission in web directories
file{
'/opt/webhosting_user_scripts/adjust_permissions':
ensure => directory,
owner => root,
group => 0,
mode => '0400';
'/opt/webhosting_user_scripts/adjust_permissions/adjust_permissions.rb':
source => 'puppet:///modules/webhosting/user_scripts/adjust_permissions/adjust_permissions.rb',
owner => root,
group => 0,
mode => '0500';
}
webhosting::user_scripts::script{'adjust_permissions': }
# update mode script
include ::acl::requirements
file{
'/opt/webhosting_user_scripts/update_mode':
ensure => directory,
owner => root,
group => 0,
mode => '0400';
'/opt/webhosting_user_scripts/update_mode/update_mode.rb':
source => 'puppet:///modules/webhosting/user_scripts/update_mode/update_mode.rb',
owner => root,
group => 0,
mode => '0500';
}
webhosting::user_scripts::script{'update_mode': }
if versioncmp($::operatingsystemmajrelease,'5') > 0 {
require ::wordpress::base
require ::tmpwatch
file{
'/opt/webhosting_user_scripts/update_wordpress':
ensure => directory,
owner => root,
group => 0,
mode => '0400';
'/opt/webhosting_user_scripts/update_wordpress/update_wordpress.rb':
source => 'puppet:///modules/webhosting/user_scripts/update_wordpress/update_wordpress.rb',
owner => root,
group => 0,
mode => '0500';
}
}
# wordpress updates
require ::wordpress::base
require ::tmpwatch
webhosting::user_scripts::script{'update_wordpress': }
}
# deploy a script
define webhosting::user_scripts::script(){
file{
"/opt/webhosting_user_scripts/${name}":
ensure => directory,
owner => root,
group => 0,
mode => '0400';
"/opt/webhosting_user_scripts/${name}/${name}.rb":
source => "puppet:///modules/webhosting/user_scripts/${name}/${name}.rb",
owner => root,
group => 0,
mode => '0500';
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment