puppet-nginx icon indicating copy to clipboard operation
puppet-nginx copied to clipboard

nginx::log_format does not get set with puppet 4

Open KlavsKlavsen opened this issue 7 years ago • 6 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: puppet-server:2.7.2-1, puppet-agent 1.9.0-1
  • Distribution: Ubuntu 16.04
  • Module version:0.6.0

How to reproduce (e.g Puppet code you use)

class { '::nginx': log_format => { 'access_log_ok' => 'whatever', 'access_log_fail' => 'whatever', } }

and in nginx/templates/conf.d/nginx.conf.erb - if you add: <%= !!@log_format %>

you get 'false' - and log_format is not added to output in nginx.conf.

I replaced: <% if @log_format -%>

with: <% if ! @log_format.empty? -%>

and it works.

What are you seeing

What behaviour did you expect instead

Output log

Any additional information you'd like to impart

KlavsKlavsen avatar May 26 '17 10:05 KlavsKlavsen

@KlavsKlavsen I can't reproduce this on Centos 7 puppet 4. For me, it works fine. Is your puppet server also Ubuntu 16.04? Could you confirm the rubyversion.

alexjfisher avatar Jun 14 '17 16:06 alexjfisher

yes. puppet master is also 16.04. But since its puppetserver - it uses the builtin ruby version that comes with it.

KlavsKlavsen avatar Jun 16 '17 06:06 KlavsKlavsen

Good point. So we should be getting the same result. A long shot, but have you set compat-version? https://docs.puppet.com/puppetserver/latest/release_notes.html#experimental-feature-run-puppet-server-in-an-mri-20-compatibility-mode

alexjfisher avatar Jun 16 '17 07:06 alexjfisher

no. I'm in bed with the flu today, but monday I can give you more details if you like. Are you testing on latest puppet 4 (4.10 I believe I am running) ? its very odd - but i guess thats why puppet choose to switch to EPP templating - to have it be controlled by their own DSL and not be hit by "all the funny quirks" you get in the intersect between puppet and ruby ERB

KlavsKlavsen avatar Jun 16 '17 07:06 KlavsKlavsen

I use "strict_variables = true".. but that should have no adverse effect (it does not work in ERB templates anyways)

KlavsKlavsen avatar Jun 16 '17 07:06 KlavsKlavsen

Back.. been a bit busy with kids and the fact the the flu like thing, turned out to be Pneumonia :) puppetserver 2.7.2-1puppetlabs1

KlavsKlavsen avatar Jun 26 '17 12:06 KlavsKlavsen