title: How to generate files based on puppet array contents?
body: <p>I'd like to be able to create files based on the contents of an array.  Here is what I have tried:</p>
  
  <pre><code>class make_files (
      $servers = ['server-1','server-2','server-3'],
  ) {
      file { $servers :
          path    =&gt; '/tmp',
          content =&gt; $servers,
      }
  }
  </code></pre>
  
  <p>... but when I execute this like so ...</p>
  
  <pre><code># puppet apply --modulepath=/root/modules -e 'include make_files'
  </code></pre>
  
  <p>... I get this output:</p>
  
  <pre><code>Notice: Compiled catalog for host-001 in environment production in 0.13 seconds
  Error: Cannot alias File[server-2] to ["/tmp"] at /root/modules/make_files/manifests/init.pp:9; resource ["File", "/tmp"] already declared at /root/modules/make_files/manifests/init.pp:9
  </code></pre>
  
  <p>I was hoping to have three files ...</p>
  
  <pre><code># ls /tmp/server-?
  /tmp/server-1  /tmp/server-2  /tmp/server-3
  # cat /tmp/server-?
  server-1
  server-2
  server-3
  </code></pre>
  
  <p>It would really be cool if someone could tell me how to get the files to be named: server-1.cfg, server-2.cfg and server-3.cfg.
  Any help is appreciated thanks!</p>