diff --git a/manifests/config/project.pp b/manifests/config/project.pp index 5f4f4fe0..254758c3 100644 --- a/manifests/config/project.pp +++ b/manifests/config/project.pp @@ -115,13 +115,13 @@ } ) - $scm_config.each |$integration, $type, $config| { + $scm_config.each |$integration, $config| { file { "${projects_dir}/${name}/scm-${integration}.json": ensure => file, owner => $owner, group => $group, mode => '0644', - content => stdlib::to_json($config), + content => stdlib::to_json($config['config']), } $_command = [ @@ -129,7 +129,7 @@ 'rd projects scm setup', "-p '${name}'", "-i ${integration}", - "-t ${type}", + "-t ${config['type']}", "-f ${projects_dir}/${name}/scm-${integration}.json", ].join(' ') diff --git a/types/scm.pp b/types/scm.pp index 6b494efc..5b2268be 100644 --- a/types/scm.pp +++ b/types/scm.pp @@ -1,11 +1,23 @@ # @summary Rundeck scm type. -type Rundeck::Scm = Struct[{ - Optional['import'] => Struct[{ - 'type' => String[1], - 'config' => Hash[String[1], String], - }], - Optional['export'] => Struct[{ - 'type' => String[1], - 'config' => Hash[String[1], String], - }], -}] +type Rundeck::Scm = Variant[ + Struct[{ + 'import' => Struct[{ + 'type' => String[1], + 'config' => Hash[String[1], String], + }], + Optional['export'] => Struct[{ + 'type' => String[1], + 'config' => Hash[String[1], String], + }], + }], + Struct[{ + 'export' => Struct[{ + 'type' => String[1], + 'config' => Hash[String[1], String], + }], + Optional['import'] => Struct[{ + 'type' => String[1], + 'config' => Hash[String[1], String], + }], + }], +]