Handling Two Puppet Classes with the Same Name
<p>I want to use the <a href="https://forge.puppetlabs.com/elasticsearch/elasticsearch" rel="nofollow">elasticsearch/elasticsearch</a> module in my own module called <code>rehan</code>. The elasticsearch/elasticsearch module provides a class called <code>elasticsearch</code>. If I also want to create a class in my module that makes use of the one in elasticsearch/elasticsearch, how can I achieve this? I have tried:</p>

<pre><code>class rehan::elasticsearch {

    class { 'elasticsearch':
        manage_repo  =&gt; true,
        repo_version =&gt; '2.2',
        require      =&gt; Class['java']
    }

    elasticsearch::instance { 'es-01':
        require =&gt; Package['elasticsearch'],
    }

}
</code></pre>

<p>The above code errors with:</p>

<blockquote>
  <p>Error: Duplicate declaration: Class[Rehan::Elasticsearch] is already declared; cannot redeclare at..</p>
</blockquote>