0
0
mirror of https://github.com/saltstack-formulas/cron-formula.git synced 2024-11-27 23:07:46 +01:00

test(saltcheck): use local map.jinja to workaround missing tpldata

This commit is contained in:
Imran Iqbal 2019-10-14 13:57:31 +01:00
parent 7911b716e8
commit 8845b3c50f
No known key found for this signature in database
GPG Key ID: 6D8629439D2B7819
4 changed files with 50 additions and 3 deletions

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{%- from "cron/map.jinja" import cron_settings with context %}
{%- from "cron/saltcheck-tests/map.jinja" import cron_settings with context %}
{%- if 'tasks' in cron_settings %}
{%- for task,task_options in cron_settings.tasks.items() %}

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{%- from "cron/map.jinja" import cron_settings with context %}
{%- from "cron/saltcheck-tests/map.jinja" import cron_settings with context %}
verify_cron.install:
module_and_function: pkg.version

View File

@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
# vim: ft=jinja
{#- Start imports as #}
{%- import_yaml "cron" ~ "/defaults.yaml" as default_settings %}
{%- import_yaml "cron" ~ "/osarchmap.yaml" as osarchmap %}
{%- import_yaml "cron" ~ "/osfamilymap.yaml" as osfamilymap %}
{%- import_yaml "cron" ~ "/osmap.yaml" as osmap %}
{%- import_yaml "cron" ~ "/osfingermap.yaml" as osfingermap %}
{#- Retrieve the config dict only once #}
{%- set _config = salt['config.get']("cron", default={}) %}
{%- set defaults = salt['grains.filter_by'](
default_settings,
default="cron",
merge=salt['grains.filter_by'](
osarchmap,
grain='osarch',
merge=salt['grains.filter_by'](
osfamilymap,
grain='os_family',
merge=salt['grains.filter_by'](
osmap,
grain='os',
merge=salt['grains.filter_by'](
osfingermap,
grain='osfinger',
merge=salt['grains.filter_by'](
_config,
default='lookup'
)
)
)
)
)
)
%}
{%- set config = salt['grains.filter_by'](
{'defaults': defaults},
default='defaults',
merge=_config
)
%}
{%- set cron = config %}

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{%- from "cron/map.jinja" import cron_settings with context %}
{%- from "cron/saltcheck-tests/map.jinja" import cron_settings with context %}
cron.service:
{%- if 'enabled' not in cron_settings or ( 'enabled' in cron_settings and cron_settings.enabled ) %}