在定义yumrepo的types时,获取错误“SERVER上的错误400:无效的参数”

我正在尝试定义一个types来创buildyum回购。 我希望能够从common.yaml中获取数据,并且定义这些数据并对其执行操作。 我没有得到这么远,我得到一个错误的一个无效的参数。 我的代码是这个..

define xh_yumrepo::create_xh_yumrepo ( $descr = '', $baseurl = $baseurl, $enabled = $enabled, $gpgcheck = $gpgcheck, ){ $ensure = 'present' notify{"title is $title":} yumrepo { $title: baseurl => $baseurl, ensure => present, descr => $descr, enabled => $enabled, gpgcheck => $gpgcheck, } } class xh_system::xh_yumrepo ( $yumrepo=hiera_hash('xh_yumrepo', undef), ){ $os=$yumrepo[$operatingsystem] $rel=$os[$operatingsystemmajrelease] notify {"$rel":} create_resources("@xh_yumrepo::create_xh_yumrepo",$rel) Xh_yumrepo::Create_xh_yumrepo <| |> } 

数据是这样的

  CentOS: "6": epel-6: descr: EPEL mirror for RHEL/CentOS 6.x 86_64 baseurl: http://repo.example.com:8080/epel/x86_64/6 enabled: 1 gpgcheck: 0 

每次运行参数确保是

错误:无法从远程服务器检索目录:SERVER上的错误400:在节点qa-test.example上的/app/copa/puppet/conf/environments/qa/modules/xh_system/manifests/xh_yumrepo.pp:17上确保无效的参数.COM

硬编码确保参数或在common.yaml中定义它给出相同的错误。 根据typesyumrepo它是一个有效的参数。 由于参数是有效的,我被卡在什么导致错误,注释掉木偶脚本工作的确保行。

ensure yumrepo的参数在Puppet 3.5.1之前并不真正支持。 甚至在3.5.0中也有多个问题。 看到这张票 。