Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Puppet 4.0 no longer supports local scope defined types #77

Open
mlehner616 opened this issue Oct 4, 2015 · 4 comments
Open

Comments

@mlehner616
Copy link
Contributor

This module breaks in Puppet 4.0 as it no longer supports locally scoped defined types as in manifests/vcl.pp. I'd like to get this into a pull request ASAP but before I do I'd like to make sure someone will be available to merge it in and provide some feedback before going through the trouble. I'm not sure if this module is actively being maintained.

I received this error after updating to Puppet 4.0:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Evaluation Error: Error while evaluating a Resource Statement, 
Invalid resource type includefile at 
/etc/puppetlabs/code/environments/dev/modules/varnish/manifests/vcl.pp:100:5 
on node varnish.local

I have patched this locally using following suggested fix.

in manifests/vcl.pp:
Move the following into manifests/includefile.pp and rename the define to varnish::includefile

  # define include file type
  define includefile {
    $selectors = $varnish::vcl::selectors
    concat { "${varnish::vcl::includedir}/${title}.vcl":
      owner   => 'root',
      group   => 'root',
      mode    => '0444',
      notify  => Service['varnish'],
      require => File[$varnish::vcl::includedir],
    }

    concat::fragment { "${title}-header":
       target  => "${varnish::vcl::includedir}/${title}.vcl",
      content => "# File managed by Puppet\n",
      order   => '01',
    }
  }

On manifests/vcl.pp line 100:
change includefile { $includefiles: }
to varnish::includefile { $includefiles: }

@maxchk
Copy link
Owner

maxchk commented Aug 4, 2016

Thanks for reporting this.
Please make a pull request and I'll merge it in.

@jeremycrussell
Copy link

jeremycrussell commented Aug 5, 2016

This is currently fixed is the "develop" branch using varnish::vcl::includefile along with quite a few other changes to that class.

@EmersonPrado
Copy link

Problem persists in defined type manifests/acl.pp and class manifests/vcl.pp, each one with a nested defined type.

EmersonPrado pushed a commit to EmersonPrado/puppet-varnish that referenced this issue Sep 29, 2017
@EmersonPrado
Copy link

Added PR 160

maxchk added a commit that referenced this issue Oct 3, 2017
[Issue #77] Move nested defined types to their own manifests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants