saltstack-formulas / bind-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
29 stars 117 forks source link

Disable query logging default #128

Open ixs opened 5 years ago

ixs commented 5 years ago

By default, the bind formula will configure the named process to write all queries into a query.log file which potentially is outside the normal log-rotated dirs, thus filling up the disk.

This is rather unexpected on high traffic DNS servers.

Disable by default, can be explicity reenabled by setting enable_logging to True.

Rework jinja logic to make enable_logging and use_extensive_logging mutually exclusive rather than having them "stacked". It makes no sense to have the fine-grained use_extensive_logging configuration depend on the coarse-grained enable_logging toggle.

I am actually tempted to rename enable_logging to enable_query_log which is a much clearer description of the functionality. Comments? Somewhat related, log_dir is /var/log/something for every OS except Red Hat where it is defined as /var/named/data... Any reason not to fix that inconsistency other than the use of the chrooted functionality on Red Hat?

javierbertoli commented 5 years ago

I like the approach you took, it LGTM :+1:

rename enable_logging to enable_query_log My only concern is backward compatibility, which we're trying to respect lately in the formulas. I'd say one possibility would be to

  1. add a new parameter enable_query_log which effectively controls the query logging (what you propose)
  2. if the old parameter enable_logging is set: 2.a. set enable_query_log to the value on enable_logging (for backward compatibility) 2.b. trigger a deprecation warning message for the parameter enable_logging

Perhaps this can be done in another PR

ixs commented 5 years ago

@javierbertoli Did that. As there's no pillar.set (contrary to grains.set) I did a bit of a workaround.

Have a look, should be passing checks now as well.

ixs commented 5 years ago

@javierbertoli ping?

n-rodriguez commented 4 years ago

Hi there! Any news?