Closed Fabian1976 closed 2 years ago
Hello @Fabian1976 and thanks for the PR! Can you take a look at the failing spec?
Seems the new parameters are not being passed correctly resulting into null values. I didn't see anything obvious from a quick look.
Yes, i will have a look. I also can't see what is wrong. I set default values in the template classes, but they seem to be ignored. I didn't ran into any issues when i was locally testing. Will try to troubleshoot it.
I think i found why i didn't see this error. I'm using the roles and profiles approach from puppet. In short, i have this in my hiera:
profile::zabbix::full_server::templates:
'Template Active Directory':
templ_source: 'puppet:///modules/zabbix_templates_generic/Template Active Directory.xml'
And the shortened code in that profile looks like this:
class profile::zabbix::full_server (
Optional[Hash] $templates = undef,
){
if $templates {
case $zabbix::zabbix_version {
/^5\.[^0]/: {
$_defaults = {
'zabbix_version' => $zabbix::zabbix_version,
}
}
default: {
$_defaults = {}
}
}
create_resources('::zabbix::template', $templates, $_defaults)
}
}
So i use the create_resources
method in combination with the class zabbix::template
(which has default values defined).
And the tests use the custom type zabbix_template
directly (which doesn't have default values defined).
I will add default values to the zabbix_template
type and check the tests again.
Considering squashing your commits once ready 😄
Ok, squashed commits and pushed
Pull Request (PR) description
Added some stuff to make the template import the same as importing from the GUI. I hope you merge it.