forked from evolix/ansible-roles
Made sure munin and logrotate use the proper path for bind logs
Not all code paths made sure that the chroot was taken into account.
This commit is contained in:
parent
b7a223dbdd
commit
7728f5f0c5
|
@ -49,18 +49,18 @@
|
|||
- restart bind
|
||||
when: ansible_distribution_release == "jessie"
|
||||
|
||||
- name: touch /var/log/bind.log if non chroot
|
||||
- name: "touch {{ bind_log_file }} if non chroot"
|
||||
file:
|
||||
path: /var/log/bind.log
|
||||
path: "{{ bind_log_file }}"
|
||||
owner: bind
|
||||
group: adm
|
||||
mode: "0640"
|
||||
state: touch
|
||||
when: not bind_chroot_set
|
||||
|
||||
- name: touch /var/log/bind_queries.log if non chroot
|
||||
- name: "touch {{ bind_query_file }} if non chroot"
|
||||
file:
|
||||
path: /var/log/bind_queries.log
|
||||
path: "{{ bind_query_file }}"
|
||||
owner: bind
|
||||
group: adm
|
||||
mode: "0640"
|
||||
|
@ -95,7 +95,7 @@
|
|||
notify: restart bind
|
||||
when: bind_chroot_set
|
||||
|
||||
- name: logrotate for non chroot bind
|
||||
- name: logrotate for bind
|
||||
template:
|
||||
src: logrotate_bind
|
||||
dest: /etc/logrotate.d/bind9
|
||||
|
@ -104,17 +104,5 @@
|
|||
mode: "0644"
|
||||
force: yes
|
||||
notify: restart bind
|
||||
when: not bind_chroot_set
|
||||
|
||||
- name: logrotate for chroot bind
|
||||
template:
|
||||
src: logrotate_bind_chroot.j2
|
||||
dest: /etc/logrotate.d/bind9
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
force: yes
|
||||
notify: restart bind
|
||||
when: bind_chroot_set
|
||||
|
||||
- include: munin.yml
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
/var/log/bind.log {
|
||||
{% if bind_chroot_set %}
|
||||
{{ bind_chroot_path }}{{bind_log_file}} {
|
||||
{% else %}
|
||||
{{bind_log_file}} {
|
||||
{% endif %}
|
||||
weekly
|
||||
missingok
|
||||
rotate 52
|
|
@ -1,10 +0,0 @@
|
|||
{{ bind_chroot_path }}/var/log/bind.log {
|
||||
weekly
|
||||
missingok
|
||||
rotate 52
|
||||
create 640 bind bind
|
||||
sharedscripts
|
||||
postrotate
|
||||
rndc reload > /dev/null
|
||||
endscript
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
[bind*]
|
||||
user root
|
||||
env.logfile {{ bind_query_file }}
|
||||
|
||||
env.logfile {% if bind_chroot_set %}{{ bind_chroot_path }}{% endif %}{{ bind_query_file }}
|
||||
{% if bind_authoritative_server %}
|
||||
env.querystats {{ bind_chroot_path }}{{ bind_statistics_file }}
|
||||
env.querystats {% if bind_chroot_set %}{{ bind_chroot_path }}{% endif %}{{ bind_statistics_file }}
|
||||
{% endif %}
|
||||
env.MUNIN_PLUGSTATE /var/lib/munin
|
||||
timeout 120
|
||||
|
|
Loading…
Reference in a new issue