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

Errors using varnish::vcl custom template #22

Open
pmblanco opened this issue May 2, 2014 · 1 comment
Open

Errors using varnish::vcl custom template #22

pmblanco opened this issue May 2, 2014 · 1 comment

Comments

@pmblanco
Copy link

pmblanco commented May 2, 2014

Hi

Using my own template for default.vcl cause errors applying puppet. I call varnish::vcl class from my own module "roles", where I have a copy of your varnish-vcl.erb template with few changes:

 class { 'varnish::vcl':
    template => "roles/cache_wp/varnish-vcl.erb",

causes:

Error: Could not find dependent Exec[concat_/etc/varnish/includes/backendselection.vcl] for File[/var/lib/puppet/concat/_etc_varnish_includes_backendselection.vcl/fragments/03_web2-selector] at /vagrant/puppet/modules/concat/manifests/fragment.pp:116

That occurs because in your vcl.pp file includefile define (where is de concat ) is only called if $template is empty.

 # select template to use
  if $template {
    $template_vcl = $template
  }
  else {
    $template_vcl = 'varnish/varnish-vcl.erb'
    file { "$includedir":
      ensure => directory,  
    }
    $includefiles = ["probes", "backends", "directors", "acls", "backendselection", "waf"]
    includefile { $includefiles: }
}

It works for me if I take the includefile sentence out of the "else":

 # select template to use
  if $template {
    $template_vcl = $template
  }
  else {
    $template_vcl = 'varnish/varnish-vcl.erb'
  }

  file { "$includedir":
    ensure => directory,    
  }
  $includefiles = ["probes", "backends", "directors", "acls", "backendselection", "waf"]
  includefile { $includefiles: }

What do you think?

@maxchk
Copy link
Owner

maxchk commented May 6, 2014

Hi Pedro,
I just merged changes made by Adrian which addressed same issue.
Could you please try latest commit and see if it works for you.
Thanks,

PeterAlfonsLoch pushed a commit to tentwentyfour/puppet-varnish that referenced this issue Jul 6, 2023
* Release 4.0.0
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

2 participants