diff --git a/manifests/agent.pp b/manifests/agent.pp index 2d02e92b2..0d1e36645 100644 --- a/manifests/agent.pp +++ b/manifests/agent.pp @@ -275,11 +275,11 @@ Stdlib::Ensure::Service $service_ensure = $zabbix::params::agent_service_ensure, Boolean $service_enable = $zabbix::params::agent_service_enable, $hostname = $zabbix::params::agent_hostname, - $hostnameitem = $zabbix::params::agent_hostnameitem, + Optional[String[1]] $hostnameitem = $zabbix::params::agent_hostnameitem, $hostmetadata = $zabbix::params::agent_hostmetadata, $hostmetadataitem = $zabbix::params::agent_hostmetadataitem, Optional[Stdlib::Fqdn] $hostinterface = $zabbix::params::agent_hostinterface, - Optional[Stdlib::Fqdn] $hostinterfaceitem = $zabbix::params::agent_hostinterfaceitem, + $hostinterfaceitem = $zabbix::params::agent_hostinterfaceitem, $refreshactivechecks = $zabbix::params::agent_refreshactivechecks, $buffersend = $zabbix::params::agent_buffersend, $buffersize = $zabbix::params::agent_buffersize, diff --git a/spec/classes/agent_spec.rb b/spec/classes/agent_spec.rb index 7e69ab5d2..de46e046c 100644 --- a/spec/classes/agent_spec.rb +++ b/spec/classes/agent_spec.rb @@ -154,6 +154,16 @@ it { is_expected.to contain_file(config_path).with_content %r{^HostInterfaceItem=system.hostname$} } end + context 'configuration file with hostinterfaceitem set to fqdn' do + let :params do + { + hostinterfaceitem: 'zabbix.example.com' + } + end + + it { is_expected.to compile.and_raise_error(%r{.*}) } + end + context 'configuration file with hostinterface' do let :params do {