Skip to content

Commit

Permalink
Added support for files to configure cluster definitions (#156)
Browse files Browse the repository at this point in the history
* Added support for files to configure cluster definitions

* Fixed cluster manifest format

* Improvements to source parameter type

Co-authored-by: treydock <[email protected]>

---------

Co-authored-by: treydock <[email protected]>
  • Loading branch information
abujeda and treydock authored Jan 25, 2024
1 parent b32fa9c commit e1a3569
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion manifests/cluster.pp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
# @param custom_config
# Custom Hash passed to `v2.custom` in cluster YAML
# @param batch_connect
# @param source
# source file to create cluster configuration from.
#
define openondemand::cluster (
String $cluster_title = $name,
Expand Down Expand Up @@ -142,6 +144,7 @@
Optional[Integer] $xdmod_resource_id = undef,
Hash $custom_config = {},
Optional[Openondemand::Batch_connect] $batch_connect = undef,
Optional[Stdlib::Filesource] $source = undef,
) {
include openondemand

Expand Down Expand Up @@ -324,12 +327,19 @@
'v2' => $v2,
}

if $source {
$content = undef
} else {
$content = to_yaml($config)
}

file { "/etc/ood/config/clusters.d/${name}.yml":
ensure => 'file',
owner => $owner,
group => $group,
mode => $mode,
content => to_yaml($config),
content => $content,
source => $source,
notify => Class['openondemand::service'],
}
}

0 comments on commit e1a3569

Please sign in to comment.