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

Cannot specify error_log severity for server definitions without overriding the auto-generated, undocumented error_log directive #1416

Open
ltning opened this issue Oct 9, 2020 · 1 comment · May be fixed by #1484

Comments

@ltning
Copy link
Contributor

ltning commented Oct 9, 2020

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.x
  • Ruby: 2.6.x
  • Distribution: FreeBSD
  • Module version: 2.0.0

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

Any nginx server definition

What are you seeing

error_log has an undocumented, magically constructed default value, and there is no way to add severity flag on a per-server level without losing the automatically named error_log.

What behaviour did you expect instead

  1. Documented auto-naming of server-level error_log
  2. Ability to specify per-server error_log severity
  3. Examples of how to specify error_log achieving the same as what the template does

Note that for 3) above, it is already understood that in explicit server definitions, error_log can be given easily. The problem is that our server definitions are template-based and auto-generated (in the thousands), so there is no way for us to specify the error_log explicitly for each. In the hiera template used for the server definitions we don't have access to the generated title (right?) and nginx does not support using server variables in error_log statements.

@ltning
Copy link
Contributor Author

ltning commented Oct 9, 2020

The following change to templates/server/server_ssl_header.erb does the trick; probably needed in other templates too:

-  error_log             <%= scope['::nginx::config::log_dir'] %>/ssl-<%= @name_sanitized %>.error.log;
+  error_log             <%= scope['::nginx::config::log_dir'] %>/ssl-<%= @name_sanitized %>.error.log <%= scope['::nginx::nginx_error_log_severity'] %>;

ltning added a commit to ltning/puppet-nginx that referenced this issue Nov 9, 2021
@ltning ltning linked a pull request Nov 9, 2021 that will close this issue
Enrice pushed a commit to Enrice/puppet-nginx that referenced this issue May 22, 2024
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

Successfully merging a pull request may close this issue.

1 participant