saltstack-formulas / bind-formula

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

Enabling Extensive Logging on CentOS 7 Issues #115

Open benbaez opened 5 years ago

benbaez commented 5 years ago

I'm following pillar.example and having issues enabling extensive logging. If I remove extensive logging all is ok with rendering.

I noticed line 117 of named.conf.local.jinja seems to expect use_extensive_logging: would be a boolean.


      ID: bind_local_config
Function: file.managed
    Name: /etc/named.conf.local
  Result: False
 Comment: Unable to manage file: Jinja variable 'salt.utils.odict.OrderedDict object' has no attribute 'logging_config'
 Started: 20:23:38.504949
Duration: 139.781 ms
 Changes:

      ID: bind
Function: service.running
    Name: named
  Result: False
 Comment: One or more requisite failed: bind.config.bind_local_config
 Started: 20:23:38.645581
Duration: 0.024 ms
 Changes:

Pillar File ...

config: tmpl: salt://bind/files/redhat/named.conf user: root group: named mode: 640 enable_logging: true use_extensive_logging: channel: default_log: file: default size: '200m' versions: '10' print-time: yes print-category: yes print-severity: yes severity: info queries_log: file: queries print-time: yes print-category: yes print-severity: yes severity: info query-errors_log: file: query-errors print-time: yes print-category: yes print-severity: yes severity: dynamic default_syslog: print-time: yes print-category: yes print-severity: yes syslog: daemon severity: info default_debug: file: named.run print-time: yes print-category: yes print-severity: yes severity: info category: default:

...

Changed to following:

...

config: tmpl: salt://bind/files/redhat/named.conf user: root group: named mode: 640 enable_logging: true

...


      ID: bind_local_config
Function: file.managed
    Name: /etc/named.conf.local
  Result: True
 Comment: File /etc/named.conf.local updated
 Started: 20:28:37.335889
Duration: 136.169 ms
 Changes:
          ----------
          diff:
              ---
              +++
              @@ -0,0 +1,19 @@
              +# vim: sts=2 ts=2 sw=2 et ai
              +//
              +// Do any local configuration here
              +//
              +
              +// Consider adding the 1918 zones here, if they are not used in your
              +// organization
              +//include "/etc/bind/zones.rfc1918";
              +
              +
              +
              +
              +logging {
              +  channel "querylog" {
              +    file "/var/named/data/query.log";
              +    print-time yes;
              +  };
              +  category queries { querylog; };
              +};
          group:
              named
          mode:
              0640

      ID: bind
Function: service.running
    Name: named
  Result: True
 Comment: Service reloaded
 Started: 20:28:37.521079
Duration: 116.846 ms
 Changes:
          ----------
          named:
              True