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?


Ah I worked it out now. The epp call needs the module name in it:

content => epp('moduleName/file.epp')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.