use user and group from pillar or map for logrotate

This commit is contained in:
Pascal Liehne 2018-03-30 00:46:00 +02:00
parent 3cbc53e207
commit 4278bca7ab

View file

@ -1,3 +1,6 @@
{%- from "bind/map.jinja" import map with context %}
{%- set user = salt['pillar.get']('bind:config:user', map.user) %}
{%- set group = salt['pillar.get']('bind:config:group', map.group) %}
{{ map.log_dir }}/query.log { {{ map.log_dir }}/query.log {
rotate 7 rotate 7
daily daily
@ -6,8 +9,8 @@
sharedscripts sharedscripts
copytruncate copytruncate
compress compress
create 0664 bind root create 0664 {{ user }} {{ group }}
{% if not salt['pkg.version']('logrotate').startswith('3.7')-%} {% if not salt['pkg.version']('logrotate').startswith('3.7')-%}
su su {{ user }} {{ group }}
{% endif %} {% endif %}
} }