瀏覽代碼

Merge pull request #55 from netmanagers/master

Fix duplicated entries for login jobs in Debian 10
tags/v0.11.5
Imran Iqbal 4 年之前
父節點
當前提交
b6096f95a3
No account linked to committer's email address
共有 2 個文件被更改,包括 46 次插入8 次删除
  1. +31
    -8
      logrotate/map.jinja
  2. +15
    -0
      logrotate/osfingermap.yaml

+ 31
- 8
logrotate/map.jinja 查看文件

@@ -1,15 +1,20 @@
# -*- coding: utf-8 -*-
# vim: ft=jinja

{%- import_yaml "logrotate/defaults.yaml" as default_settings %}
{%- import_yaml "logrotate/osfamilymap.yaml" as osfamilymap %}
{%- import_yaml "logrotate/osmap.yaml" as osmap %}
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{#- Start imports as #}
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
{%- import_yaml tplroot ~ "/osmap.yaml" as osmap %}
{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %}

{#- Retrieve the config dict only once #}
{%- set _config = salt['config.get']('logrotate', default={}) %}
{%- set _config = salt['config.get'](tplroot, default={}) %}

{%- set defaults = salt['grains.filter_by'](
default_settings,
default='logrotate',
default=tplroot,
merge=salt['grains.filter_by'](
osfamilymap,
grain='os_family',
@@ -17,12 +22,30 @@
osmap,
grain='os',
merge=salt['grains.filter_by'](
_config,
default='lookup'
osfingermap,
grain='osfinger',
merge=salt['grains.filter_by'](
_config,
default='lookup'
)
)
)
)
)
%}

{%- set logrotate = defaults %}
{%- set config = salt['grains.filter_by'](
{'defaults': defaults},
default='defaults',
merge=_config
)
%}

{#- Change **logrotate** to match with your formula's name and then remove this line #}
{%- set logrotate = config %}

{#- Post-processing for specific non-YAML customisations #}
{%- if grains.os == 'MacOS' %}
{%- set macos_group = salt['cmd.run']("stat -f '%Sg' /dev/console") %}
{%- do logrotate.update({'rootgroup': macos_group}) %}
{%- endif %}

+ 15
- 0
logrotate/osfingermap.yaml 查看文件

@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
#
# Setup variables using grains['osfinger'] based logic.
# You just need to add the key:values for an `osfinger` that differ
# from `defaults.yaml` + `osarch.yaml` + `os_family.yaml` + `osmap.yaml`.
# Only add an `osfinger` which is/will be supported by the formula.
#
# If you do not need to provide defaults via the `os_finger` grain,
# you will need to provide at least an empty dict in this file, e.g.
# osfingermap: {}
---
# os: Debian
Debian-10:
login_records_jobs: false

Loading…
取消
儲存