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:
parent
7911b716e8
commit
8845b3c50f
@ -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() %}
|
||||
|
@ -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
|
||||
|
47
cron/saltcheck-tests/map.jinja
Normal file
47
cron/saltcheck-tests/map.jinja
Normal 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 %}
|
@ -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 ) %}
|
||||
|
Loading…
Reference in New Issue
Block a user