title: Puppet Error : Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Could not find class
body: <p>I am testing this out and getting an error on the Puppet agent node</p>
  
  <pre><code>[root@pagent1 ~]# puppet agent -t
  Info: Using configured environment 'production'
  Info: Retrieving pluginfacts
  Info: Retrieving plugin
  Info: Retrieving locales
  Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::nginx for pagent1.testcentos7.com (file: /etc/puppetlabs/code/environments/production/manifests/site.pp, line: 3, column: 3) on node pagent1.testcentos7.com
  Warning: Not using cache on failed catalog
  Error: Could not retrieve catalog; skipping run
  </code></pre>
  
  <p>Content of these classes from the Puppet server:</p>
  
  <pre><code>[root@pmaster ~]# cat /etc/puppetlabs/code/environments/production/manifests/site.pp
  node pagent1.testcentos7.com {
    class { 'nginx': }
  }
  
  [root@pmaster ~]# cat /etc/puppetlabs/code/environments/production/modules/nginx/manifests/manifests/init.pp
  class nginx {
    contain nginx::install
  }
  
  [root@pmaster ~]# cat /etc/puppetlabs/code/environments/production/modules/nginx/manifests/install.pp
  class nginx::install {
    package { 'install_nginx':
      name    =&gt; 'nginx',
      ensure  =&gt; 'present',
    }
  }
  </code></pre>
  
  <p>Syntax check shows this error:</p>
  
  <pre><code>[root@pmaster ~]# puppet parser validate /etc/puppetlabs/code/environments/production/modules/nginx/manifests/manifests/init.pp
  Error: Could not parse for environment production: Unacceptable location. The name 'nginx' is unacceptable in file '/etc/puppetlabs/code/environments/production/modules/nginx/manifests/manifests/init.pp' (file: /etc/puppetlabs/code/environments/production/modules/nginx/manifests/manifests/init.pp, line: 7, column: 1)
  </code></pre>
  
  <p>NOTE: Created module 'nginx' and its classes using Puppet Development Kit(PDK).</p>
  
  <p>Is that a bug or something or I made a mistake with the class name?. </p>
  
  <p>Related thread I found is <a href="https://groups.google.com/forum/embed/#!topic/puppet-users/nxbwCvWrgMI" rel="nofollow noreferrer">https://groups.google.com/forum/embed/#!topic/puppet-users/nxbwCvWrgMI</a> but would like to have someone simplify this for me</p>