Commit 6623b348 authored by mh's avatar mh
Browse files

extract into a variable

parent 4c127d67
......@@ -2,6 +2,12 @@
class webhosting::user_scripts (
$default_contact_domain = false,
$notifications_sender = "root@${facts['networking']['fqdn']}",
Hash[String[1], Variant[String[1],Boolean]] $scripts_to_deploy = {
'adjust_permissions' => 'dirs',
'update_mode' => false,
'update_wordpress' => 'dirs',
'ssh_authorized_keys' => 'keys',
},
) {
require incron
......@@ -26,8 +32,7 @@ class webhosting::user_scripts (
mode => '0500';
}
# deploy scripts
['adjust_permissions','update_mode',
'update_wordpress','ssh_authorized_keys'].each |String $script_name| {
$scripts_to_deploy.keys.each |String $script_name| {
file {
"/opt/webhosting_user_scripts/${script_name}":
ensure => directory,
......
......@@ -62,12 +62,7 @@ define webhosting::user_scripts::manage (
mode => '0440';
}
$scripts_to_deploy = { 'adjust_permissions' => 'dirs',
'update_mode' => false,
'update_wordpress' => 'dirs',
'ssh_authorized_keys' => 'keys',
}
$scripts_to_deploy.each |String $script_name, Variant[String, Boolean] $config_ext| {
$webhosting::user_scripts::scripts_to_deploy.each |String $script_name, Variant[String, Boolean] $config_ext| {
if ($script_name in $scripts) or ($scripts == 'ALL') {
file {
"${scripts_path}/${script_name}":
......
Markdown is supported
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