Answers: <p>Ah I worked it out now.  The epp call needs the module name in it:</p>
  
  <pre><code>content =&gt; epp('moduleName/file.epp')
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2019-07-25T14:13:38.797Z
Answers: 2019-07-25T14:13:38.797Z
Answers: Sugarat
Body: <p>I am attempting to use an EPP template in Puppet 6.2.0. </p>
  
  <p>I have the following file /etc/puppetlabs/code/modules/profile/manifests/linux/base/dns.pp :</p>
  
  <pre><code>class profile::linux::base::dns {
    file { '/etc/resolv.conf':
      path =&gt; '/etc/resolv.conf',
      ensure =&gt; file,
      owner =&gt; root,
      group =&gt; root,
      mode =&gt; 0644,
      content =&gt; epp('etc/resolv.conf.epp'),
  }
  </code></pre>
  
  <p>The EPP template file is /etc/puppetlabs/code/modules/profile/templates/etc/resolv.conf.epp:</p>
  
  <pre><code># This file is managed by Puppet. Manual modifications will be overridden.
  domain &lt;%= lookup('profile::linux::base::domainName') %&gt;
  </code></pre>
  
  <p>However, the catalog does not compile with the error : 'Could not find template 'etc/resolv.conf.epp'</p>
  
  <p>Why can this module not find the template, when it resides in the modules own template directory? </p>
  
Tags: <puppet>
Title: Puppet cannot find epp template
UserDisplayName: Sugarat
ThreadText: # Puppet cannot find epp template
  
  (Asked by: username_0 on 2019-07-25)
  
  I am attempting to use an EPP template in Puppet 6.2.0.
  
  I have the following file /etc/puppetlabs/code/modules/profile/manifests/linux/base/dns.pp :
  
  ```
  class profile::linux::base::dns {
    file { '/etc/resolv.conf':
      path => '/etc/resolv.conf',
      ensure => file,
      owner => root,
      group => root,
      mode => 0644,
      content => epp('etc/resolv.conf.epp'),
  }
  
  ```
  
  The EPP template file is /etc/puppetlabs/code/modules/profile/templates/etc/resolv.conf.epp:
  
  ```
  # This file is managed by Puppet. Manual modifications will be overridden.
  domain <%= lookup('profile::linux::base::domainName') %>
  
  ```
  
  However, the catalog does not compile with the error : 'Could not find template 'etc/resolv.conf.epp'
  
  Why can this module not find the template, when it resides in the modules own template directory?
  
  **Tags:** puppet
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-07-25. Score: 1
  
  Ah I worked it out now. The epp call needs the module name in it:
  
  ```
  content => epp('moduleName/file.epp')
  
  ```
  
  
  ---
  
  