Closed mleiner closed 3 years ago
@alexjfisher @bastelfreak @blkperl can you have a look and merge this ?
thanks for the work! can you please add some tests in https://github.com/voxpupuli/puppet-nrpe/blob/master/spec/classes/nrpe_spec.rb that verify it works with the different ip/cidr/fqdn formats?
@bastelfreak I've fixed the syntax and added positive spec tests for allowed_hosts. I skipped negative tests since I expect stdlib to catch type mismatches. Is that correct?
looks good to me. can you take a look at the indentation in templates/nrpe.cfg.epp ?
I have fixed the template syntax, too. Sorry for not checking while I already worked on init.pp.
thanks!
Are you planning a new release?
I would like to, but that's currently blocked by https://github.com/voxpupuli/puppet-nrpe/pull/48
This fixes Issue #46.
allowed_hosts of nrpe.cfg can be set to
The current code uses Stdlib::Host which ultimatively resolves to FQDNs and pure IP addresses, but not subnets. It uses Stdlib::Compat, too.
Changing Stdlib::Host to Variant[Stdlib::Fqdn,Stdlib::IP::Address] solves this by
This gets rid of the Stdlib::Compat layer and allows
allowed_hosts
to accept IP addresses with subnets, too.I have not found any spec tests for allowed_hosts, thus didn't change existing ones. I can try to add those if you like.
I've tested locally with
Improvement suggestions welcome