Merge pull request #53 from myii/bug/fix-for-salt-ssh
fix: make necessary modifications to get working on `salt-ssh`
This commit is contained in:
commit
589cd17578
3 changed files with 25 additions and 21 deletions
|
@ -11,6 +11,8 @@ logrotate-config:
|
||||||
- user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
|
- user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
|
||||||
- group: {{ salt['pillar.get']('logrotate:config:group', logrotate.group) }}
|
- group: {{ salt['pillar.get']('logrotate:config:group', logrotate.group) }}
|
||||||
- mode: {{ salt['pillar.get']('logrotate:config:mode', '644') }}
|
- mode: {{ salt['pillar.get']('logrotate:config:mode', '644') }}
|
||||||
|
- context:
|
||||||
|
logrotate: {{ logrotate|tojson }}
|
||||||
|
|
||||||
logrotate-directory:
|
logrotate-directory:
|
||||||
file.directory:
|
file.directory:
|
||||||
|
|
|
@ -1,25 +1,28 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# vim: ft=jinja
|
# vim: ft=jinja
|
||||||
|
|
||||||
{% import_yaml 'logrotate/defaults.yaml' as default_settings %}
|
{%- import_yaml "logrotate/defaults.yaml" as default_settings %}
|
||||||
{% import_yaml "logrotate/osfamilymap.yaml" as os_family_map %}
|
{%- import_yaml "logrotate/osfamilymap.yaml" as osfamilymap %}
|
||||||
{% import_yaml "logrotate/osmap.yaml" as os_map %}
|
{%- import_yaml "logrotate/osmap.yaml" as osmap %}
|
||||||
|
|
||||||
{% set osfam = salt['grains.filter_by'](
|
{#- Retrieve the config dict only once #}
|
||||||
os_family_map,
|
{%- set _config = salt['config.get']('logrotate', default={}) %}
|
||||||
grain='os_family',
|
{%- set defaults = salt['grains.filter_by'](
|
||||||
) or {} %}
|
default_settings,
|
||||||
{% set os = salt['grains.filter_by'](
|
default='logrotate',
|
||||||
os_map,
|
merge=salt['grains.filter_by'](
|
||||||
grain='os',
|
osfamilymap,
|
||||||
) or {} %}
|
grain='os_family',
|
||||||
|
merge=salt['grains.filter_by'](
|
||||||
{% do salt['defaults.merge'](default_settings['logrotate'], osfam) %}
|
osmap,
|
||||||
{% do salt['defaults.merge'](default_settings['logrotate'], os) %}
|
grain='os',
|
||||||
|
merge=salt['grains.filter_by'](
|
||||||
{% set logrotate = salt['pillar.get'](
|
_config,
|
||||||
'logrotate:lookup',
|
default='lookup'
|
||||||
default=default_settings['logrotate'],
|
)
|
||||||
merge=True,
|
)
|
||||||
) %}
|
)
|
||||||
|
)
|
||||||
|
%}
|
||||||
|
|
||||||
|
{%- set logrotate = defaults %}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
{%- from "logrotate/map.jinja" import logrotate with context -%}
|
|
||||||
{%- set config = salt['pillar.get']('logrotate:default_config', logrotate.default_config) -%}
|
{%- set config = salt['pillar.get']('logrotate:default_config', logrotate.default_config) -%}
|
||||||
|
|
||||||
{%- set processed_parameters = [] -%}
|
{%- set processed_parameters = [] -%}
|
||||||
|
|
Loading…
Reference in a new issue