hiera_include equivalent for resource types
- by quickshiftin
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')
}