style(jinja): use Jinja whitespace control

This commit is contained in:
Imran Iqbal 2019-03-30 23:10:19 +00:00
parent 0eaf78c627
commit 2d1f7c2601
No known key found for this signature in database
GPG Key ID: 6D8629439D2B7819
4 changed files with 30 additions and 30 deletions

View File

@ -1,41 +1,41 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{% from "cron/map.jinja" import cron_settings with context %}
{%- from "cron/map.jinja" import cron_settings with context %}
{% if 'tasks' in cron_settings %}
{% for task,task_options in cron_settings.tasks.items() %}
{%- if 'tasks' in cron_settings %}
{%- for task,task_options in cron_settings.tasks.items() %}
cron.{{ task }}:
cron.{{ task_options.type|default('present') }}:
- name: '{{ task_options.name }}'
{% if 'user' in task_options %}
{%- if 'user' in task_options %}
- user: {{ task_options.user|default('root') }}
{% endif %}
{% if 'minute' in task_options %}
{%- endif %}
{%- if 'minute' in task_options %}
- minute: '{{ task_options.minute }}'
{% endif %}
{% if 'hour' in task_options %}
{%- endif %}
{%- if 'hour' in task_options %}
- hour: '{{ task_options.hour }}'
{% endif %}
{% if 'daymonth' in task_options %}
{%- endif %}
{%- if 'daymonth' in task_options %}
- daymonth: '{{ task_options.daymonth }}'
{% endif %}
{% if 'month' in task_options %}
{%- endif %}
{%- if 'month' in task_options %}
- month: '{{ task_options.month }}'
{% endif %}
{% if 'dayweek' in task_options %}
{%- endif %}
{%- if 'dayweek' in task_options %}
- dayweek: '{{ task_options.dayweek }}'
{% endif %}
{% if 'commented' in task_options and task_options.commented %}
{%- endif %}
{%- if 'commented' in task_options and task_options.commented %}
- commented: True
{% endif %}
{% if 'special' in task_options %}
{%- endif %}
{%- if 'special' in task_options %}
- special: '{{ task_options.special }}'
{% endif %}
{%- endif %}
- identifier: '{{ task }}'
{% if 'comment' in task_options %}
{%- if 'comment' in task_options %}
- comment: '{{ task_options.comment }}'
{% endif %}
{% endfor %}
{% endif %}
{%- endif %}
{%- endfor %}
{%- endif %}

View File

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

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# vim: ft=jinja
{% set os_family_map = salt['grains.filter_by']({
{%- set os_family_map = salt['grains.filter_by']({
'RedHat': {
'pkg': 'cronie',
'service': 'crond',
@ -16,7 +16,7 @@
},
}, grain='os_family', merge=salt['pillar.get']('cron:lookup')) %}
{% set cron_settings = salt['pillar.get'](
{%- set cron_settings = salt['pillar.get'](
'cron',
default=os_family_map,
merge=True

View File

@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{% from "cron/map.jinja" import cron_settings with context %}
{%- from "cron/map.jinja" import cron_settings with context %}
cron.service:
{% if 'enabled' not in cron_settings or ( 'enabled' in cron_settings and cron_settings.enabled ) %}
{%- if 'enabled' not in cron_settings or ( 'enabled' in cron_settings and cron_settings.enabled ) %}
service.running:
- name: {{ cron_settings.service }}
- enable: True
{% else %}
{%- else %}
service.dead:
- name: {{ cron_settings.service }}
- enable: False
{% endif %}
{%- endif %}