Skip to content

Commit

Permalink
add joiner class
Browse files Browse the repository at this point in the history
  • Loading branch information
fschaer committed Dec 9, 2013
1 parent 404023b commit 596472b
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
46 changes: 46 additions & 0 deletions manifests/joiner.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* For those willing to run multiple apel publishers for multiple subsites, an instance is needed for each site
* You must include the apelpublisher::params before cllaing this include if you want to make sure all default params are there.
*
* The resource title can be the GOC DB site name
*/
define apelpublisher::joiner(
$mysql_hostname = $apelpublisher::params::mysql_hostname,
$mysql_port = $apelpublisher::params::mysql_port,
$mysql_database = $apelpublisher::params::mysql_database,
$mysql_user = $apelpublisher::params::mysql_user,
$mysql_password = $apelpublisher::params::mysql_apel_password,
$site_name = $title, #this is the GOC DB name
$ldap_host = $apelpublisher::params::ldap_host, #this is the BDII where SPEC information will be looked up
$ldap_port = $apelpublisher::params::ldap_port,
$joiner_local_jobs = $apelpublisher::params::joiner_local_jobs,
$unloader_enabled = $apelpublisher::params::unloader_enabled,
$unloader_dir_location = $apelpublisher::params::unloader_dir_location,
$unloader_send_summaries = $apelpublisher::params::unloader_send_summaries,
$unloader_withhold_dns = $apelpublisher::params::unloader_withhold_dns,
$ssm_enabled = false,
$joiner_enabled = true,
$logging_logfile = $apelpublisher::params::logging_logfile,
$logging_level = $apelpublisher::params::logging_level,
$logging_console = $apelpublisher::params::logging_console,
$cron_minutes = $apelpublisher::params::cron_minutes,
$cron_hours = $apelpublisher::params::cron_hours,

) {

$config="/etc/apel/client-${title}.cfg"
file { $config :
owner => "root",
group => "root",
ensure => "present",
content => template("${module_name}/client.cfg.erb"),
require => [Package['apel-client'],Package['apel-ssm']],
}

cron { "apelclient-${title}":
command => "/usr/bin/apelclient -c $config",
user => root,
hour => $cron_hours,
minute => $cron_minutes,
}
}
6 changes: 3 additions & 3 deletions templates/client.cfg.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ldap_port = <%= ldap_port %>
#spec_value = 1.0

[joiner]
enabled = true
enabled = <%= @joiner_enabled %>
local_jobs = false

[unloader]
Expand All @@ -36,7 +36,7 @@ dir_location = /var/spool/apel/
# You may send only summaries of your data to the APEL server,
# rather than individual job records.
# This reduces the network load.
send_summaries = false
send_summaries = <%= @unloader_send_summaries %>

# You may send 'withheld' instead of the user's DN in the
# GlobalUserName field. This is only valid for individual
Expand Down Expand Up @@ -66,7 +66,7 @@ interval = latest
send_ur = false

[ssm]
enabled = true
enabled = <%= @ssm_enabled %>

[logging]
logfile = /var/log/apel/client.log
Expand Down

0 comments on commit 596472b

Please sign in to comment.