title: Foreman/Puppet module pdxcat/collectd. Syntax of hash
body: <p>New to puppet and trying to get this module to work, but finding it quite frustrating.</p>
  
  <pre><code>Error: Could not retrieve catalog from remote server: Error 400 on SERVER: can't convert String into Hash at /etc/puppet/modules/collectd/manifests/plugin/network.pp:28
  </code></pre>
  
  <p>The plugin I am struggling with is this one:
  <a href="https://forge.puppetlabs.com/pdxcat/collectd#class-collectdpluginnetwork" rel="nofollow">https://forge.puppetlabs.com/pdxcat/collectd#class-collectdpluginnetwork</a></p>
  
  <p>The value I am trying to set is servers under collectd::plugin::network 
  I have tried:</p>
  
  <pre><code>('127.0.0.1': port =&gt; 25826,) and 
  ('hostname' '127.0.0.1' 'port' 25826) and '127.0.0.1': port =&gt; 25826,
  </code></pre>
  
  <p>and a myriad of other options.</p>
  
  <p>Could somebody please let me know how to write a valid hash?</p>
  
  <p>The manifest:</p>
  
  <pre><code>[root@foreman ~]# cat /etc/puppet/modules/collectd/manifests/plugin/network/server.pp
  #
  define collectd::plugin::network::server (
    $ensure        = 'present',
    $username      = undef,
    $password      = undef,
    $port          = undef,
    $securitylevel = undef,
    $interface     = undef,
  ) {
    include collectd::params
    include collectd::plugin::network
  
    $conf_dir = $collectd::params::plugin_conf_dir
  
    validate_string($name)
  
    file { "${conf_dir}/network-server-${name}.conf":
      ensure  =&gt; $ensure,
      mode    =&gt; '0640',
      owner   =&gt; 'root',
      group   =&gt; $collectd::params::root_group,
      content =&gt; template('collectd/plugin/network/server.conf.erb'),
      notify  =&gt; Service['collectd'],
    }
  }
  </code></pre>