hiera_include equivalent for resource types

Posted by quickshiftin on Server Fault See other posts from Server Fault or by quickshiftin
Published on 2013-10-30T18:42:36Z Indexed on 2013/10/30 21:59 UTC
Read the original article Hit count: 457

Filed under:
|

I'm using the yumrepo built-in type. I can get a basic integration to hiera working

  yumrepo { hiera('yumrepo::name') :
    metadata_expire => hiera('yumrepo::metadata_expire'),
    descr           => hiera('yumrepo::descr'),
    gpgcheck        => hiera('yumrepo::gpgcheck'),
    http_caching    => hiera('yumrepo::http_caching'),
    baseurl         => hiera('yumrepo::baseurl'),
    enabled         => hiera('yumrepo::enabled'),
  }

If I try to remove that definition and instead go for hiera_include('classes'), here's what I've got in the corresponding yaml backend

classes:
 - "yumrepo"

yumrepo::metadata_expire: 0
yumrepo::descr: "custom repository"
yumrepo::gpgcheck: 0
yumrepo::http_caching: none
yumrepo::baseurl: "http://myserver/custom-repo/$basearch"
yumrepo::enabled: 1

I get this error on an agent

Error 400 on SERVER: Could not find class yumrepo

I guess you can't get away from some sort of minimal node declaration w/ hiera and resource types? Maybe hiera_hash is the way to go?

I gave this a shot, but it produces a syntax error

  yumrepo { 'hnav-development':
    hiera_hash('yumrepo')
  }

© Server Fault or respective owner

Related posts about puppet

Related posts about hiera