title: How to use concat in puppet for combining two files into same file?
body: <pre><code>define nagios::iconf( $host_name='', $ip='', $short_alias='',$service_name='',$remote_host_name='',$port=''){
  $reconfigure = "/usr/local/nagios/etc/import/${host_name}.cfg"
  
     concat{$reconfigure:
        owner =&gt; nagios,
        group =&gt; nagios,
        mode  =&gt; 755
     }
  
     concat::fragment{"hosttemplate":
        target =&gt; $reconfigure,
        source =&gt; template('nagios/host.erb'),
        order  =&gt; 01,
     }
  
     concat::fragment{"servicetemplate":
        target =&gt; $reconfigure,
        ensure  =&gt; template("nagios/${service_name}.erb"),
        order   =&gt; 15
     }
  }
  include nagios
  </code></pre>
  
  <p>When I declare in site.pp </p>
  
  <pre><code>node "blahblahhostname"{
  nagios::iconf{'name1':
    host_name       =&gt; 'localhost'
    remote_host_name =&gt; 'blahblah1',
    ip      =&gt; '32.232.434.323',
    port    =&gt; '111',
    short_alias     =&gt; 'random',
    service_name    =&gt; 'servicename1'
  }
  
  nagios::iconf{'name2':
    host_name       =&gt; 'localhost'
    remote_host_name =&gt; 'blahblah1',
    ip      =&gt; '32.232.434.323',
    port    =&gt; '111',
    short_alias     =&gt; 'random',
    service_name    =&gt; 'servicename2'
  }
  include nagios
  }
  </code></pre>
  
  <p>I get duplicate declaration error. Where did I go wrong?</p>