title: Puppet: Multiple manifests in module
body: <p>I am trying to create <code>Puppet</code> module to setup my web server.</p>
  
  <p>What i want - is to split configuration to logical modules (manifests by services: <code>webserver</code>, <code>database</code>, <code>ftp</code> etc.) But I can not figure out how to use additional manifests in <code>init.pp</code></p>
  
  <p><em>I am going to use it only with <code>puppet apply</code> not server-client configuration.</em></p>
  
  <p>My text module manifest (kp/manifests/init.pp):</p>
  
  <pre><code>class kp {
      include kp::testfile
  }
  
  include kp
  </code></pre>
  
  <p>And additional manifest (kp/manifests/testfile.pp)</p>
  
  <pre><code>define kp::testfile {
  
      $value = template("kp/some.erb")
  
      file { 'testfile':
          path    =&gt; '/tmp/my.txt',
          ensure  =&gt; file,
          content =&gt; $value
      }
  }
  </code></pre>
  
  <p>Documentation says:</p>
  
  <pre><code>If a class is defined in a module, you can declare that class by name in any manifest. Puppet will automatically find and load the manifest that contains the class definition.
  </code></pre>
  
  <p>But when I run <code>puppet apply init.pp</code> I am getting error message</p>
  
  <pre><code>Could not find class kp::testfile for myhost.com at /myDir/puppetModules/kp/manifests/init.pp:2 on node vagrant.example.com
  </code></pre>
  
  <p>Facts</p>
  
  <ul>
  <li><code>/myDir/puppetModules/</code> is in <code>modulepath</code> so no problems here</li>
  <li>Puppet version v2.7.11</li>
  <li>Ubuntu 12.04 LTS</li>
  </ul>
  
  <p>What I am doing wrong?
  Thanks in advance!</p>