Skip to content

Commit

Permalink
Merge pull request #95 from ccin2p3/feature/custom_params
Browse files Browse the repository at this point in the history
Feature: custom params
  • Loading branch information
kreczko authored Jul 17, 2018
2 parents 8d7d0db + 0b0bf0a commit 7672631
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 3 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ Puppetforge: https://forge.puppetlabs.com/HEPPuppet/htcondor
4. [Singularity container support](#singularity)
5. [Kerberos authentication support](#kerberos)
6. [Additional logging parameters](#logging)
7. [Limitations - OS compatibility, etc.](#limitations)
8. [Development - Guide for contributing to the module](#development)
7. [Additional custom parameters](#custom-parameters)
8. [Limitations - OS compatibility, etc.](#limitations)
9. [Development - Guide for contributing to the module](#development)
* [Contributing to the htcondor module](#contributing)
* [Running tests - A quick guide](#running-tests)

Expand Down Expand Up @@ -120,7 +121,7 @@ This will deploy a map file containing the entries listed in the `krb_mapfile_en
If you want HTCondor to use custom logging parameters, you may specify `use_custom_logs` and the `logging_parameters` hash with the `{parameter_name => desired_value}` form. For example:
```
use_custom_logs => true,
$logging_parameters => { 'SCHEDD_DEBUG' => 'D_NETWORK,D_PROTOCOL', NEGOTIATOR_DEBUG' => 'D_FULLDEBUG', ... }
logging_parameters => { 'SCHEDD_DEBUG' => 'D_NETWORK,D_PROTOCOL', NEGOTIATOR_DEBUG' => 'D_FULLDEBUG', ... }
```
Please note that no verification is applied, you have to carefully check your syntax to ensure daemons will restart correctly.

Expand All @@ -130,6 +131,15 @@ use_custom_logs => true,
log_to_syslog => true,
```

## Custom parameters
If you want HTCondor to use custom parameters which are not managed elsewhere in the module, you may specify `custom_knobs` hash with the `{parameter_name => desired_value}` form. For example:
```
custom_knobs => { 'CLAIM_PARTITIONABLE_LEFTOVERS' => 'false', ... }
```
Please note that:
* no verification is applied, you have to carefully check your syntax to ensure daemons will restart correctly
* these parameters will be deployed on all nodes (workers, schedulers and managers)

## Limitations
### General

Expand Down
6 changes: 6 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
# Logging params configuration
$logging_class = 'htcondor::config::logging'

# Custom params configuration
$custom_knobs_class = 'htcondor::config::custom_knobs'

class { $common_class: }
contain "${common_class}"
$more_than_two_managers = size($managers) > 1
Expand Down Expand Up @@ -54,6 +57,9 @@
contain "${logging_class}"
}

class { $custom_knobs_class: }
contain "${custom_knobs_class}"

if $use_shared_port {
class { $sharedport_class: }
contain "${sharedport_class}"
Expand Down
21 changes: 21 additions & 0 deletions manifests/config/custom_knobs.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# A config file for custom parameters not managed anywhere else
class htcondor::config::custom_knobs(
$custom_knobs = $htcondor::custom_knobs,
$template_custom_knobs = $htcondor::template_custom_knobs,
$condor_user = $htcondor::condor_user,
$condor_group = $htcondor::condor_group,
)
{
if $custom_knobs != {} {
file { '/etc/condor/config.d/60_custom_knobs.config':
content => template($template_custom_knobs),
require => Package['condor'],
owner => $condor_user,
group => $condor_group,
mode => '0644',
notify => Exec['/usr/sbin/condor_reconfig'],
}
}
}

# vim: ft=puppet
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
$template_defrag = $htcondor::params::template_defrag,
$template_sharedport = $htcondor::params::template_sharedport,
$template_logging = $htcondor::params::template_logging,
$template_custom_knobs = $htcondor::params::template_custom_knobs,
$template_singularity = $htcondor::params::template_singularity,
$template_highavailability =
$htcondor::params::template_highavailability,
Expand Down Expand Up @@ -225,6 +226,7 @@
$use_custom_logs = $htcondor::params::use_custom_logs,
$log_to_syslog = $htcondor::params::log_to_syslog,
$logging_parameters = $htcondor::params::logging_parameters,
$custom_knobs = $htcondor::params::custom_knobs,
$use_singularity = $htcondor::params::use_singularity,
$singularity_path = $htcondor::params::singularity_path,
$force_singularity_jobs = $htcondor::params::force_singularity_jobs,
Expand Down
5 changes: 5 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@
$log_to_syslog = hiera('log_to_syslog', false)
$logging_parameters = hiera('logging_parameters', {})

# Custom knobs config
$custom_knobs = hiera('custom_knobs', {})

# Singularity configuration
$use_singularity = hiera('use_singularity', false)
$singularity_path = hiera('singularity_path', '/usr/bin/singularity')
Expand Down Expand Up @@ -188,6 +191,8 @@
)
$template_logging = hiera('template_logging', "${module_name}/14_logging.config.erb"
)
$template_custom_knobs = hiera('template_custom_knobs', "${module_name}/60_custom_knobs.config.erb"
)
$template_singularity = hiera('template_singularity', "${module_name}/50_singularity.config.erb"
)
}
5 changes: 5 additions & 0 deletions templates/60_custom_knobs.config.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<% if @custom_knobs.any? -%>
<% @custom_knobs.each do |param, value| -%>
<%=param -%> = <%=value %>
<% end -%>
<% end -%>

0 comments on commit 7672631

Please sign in to comment.