1
0
Fork 0
mirror of synced 2024-12-30 09:49:28 -05:00

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:
Imran Iqbal 2020-05-07 08:45:36 +01:00 committed by GitHub
commit 589cd17578
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 21 deletions

View file

@ -11,6 +11,8 @@ logrotate-config:
- user: {{ salt['pillar.get']('logrotate:config:user', logrotate.user) }}
- group: {{ salt['pillar.get']('logrotate:config:group', logrotate.group) }}
- mode: {{ salt['pillar.get']('logrotate:config:mode', '644') }}
- context:
logrotate: {{ logrotate|tojson }}
logrotate-directory:
file.directory:

View file

@ -1,25 +1,28 @@
# -*- coding: utf-8 -*-
# vim: ft=jinja
{% import_yaml 'logrotate/defaults.yaml' as default_settings %}
{% import_yaml "logrotate/osfamilymap.yaml" as os_family_map %}
{% import_yaml "logrotate/osmap.yaml" as os_map %}
{%- import_yaml "logrotate/defaults.yaml" as default_settings %}
{%- import_yaml "logrotate/osfamilymap.yaml" as osfamilymap %}
{%- import_yaml "logrotate/osmap.yaml" as osmap %}
{% set osfam = salt['grains.filter_by'](
os_family_map,
{#- Retrieve the config dict only once #}
{%- set _config = salt['config.get']('logrotate', default={}) %}
{%- set defaults = salt['grains.filter_by'](
default_settings,
default='logrotate',
merge=salt['grains.filter_by'](
osfamilymap,
grain='os_family',
) or {} %}
{% set os = salt['grains.filter_by'](
os_map,
merge=salt['grains.filter_by'](
osmap,
grain='os',
) or {} %}
{% do salt['defaults.merge'](default_settings['logrotate'], osfam) %}
{% do salt['defaults.merge'](default_settings['logrotate'], os) %}
{% set logrotate = salt['pillar.get'](
'logrotate:lookup',
default=default_settings['logrotate'],
merge=True,
) %}
merge=salt['grains.filter_by'](
_config,
default='lookup'
)
)
)
)
%}
{%- set logrotate = defaults %}

View file

@ -1,4 +1,3 @@
{%- from "logrotate/map.jinja" import logrotate with context -%}
{%- set config = salt['pillar.get']('logrotate:default_config', logrotate.default_config) -%}
{%- set processed_parameters = [] -%}