0
0
mirror of https://github.com/saltstack-formulas/cron-formula.git synced 2025-02-17 17:54:48 +01:00

style(whitespace): base on multiples of 2 rather than 4

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

View File

@ -7,35 +7,35 @@
{% for task,task_options in cron_settings.tasks.items() %} {% for task,task_options in cron_settings.tasks.items() %}
cron.{{ task }}: cron.{{ task }}:
cron.{{ task_options.type|default('present') }}: cron.{{ task_options.type|default('present') }}:
- name: '{{ task_options.name }}' - name: '{{ task_options.name }}'
{% if 'user' in task_options %} {% if 'user' in task_options %}
- user: {{ task_options.user|default('root') }} - user: {{ task_options.user|default('root') }}
{% endif %} {% endif %}
{% if 'minute' in task_options %} {% if 'minute' in task_options %}
- minute: '{{ task_options.minute }}' - minute: '{{ task_options.minute }}'
{% endif %} {% endif %}
{% if 'hour' in task_options %} {% if 'hour' in task_options %}
- hour: '{{ task_options.hour }}' - hour: '{{ task_options.hour }}'
{% endif %} {% endif %}
{% if 'daymonth' in task_options %} {% if 'daymonth' in task_options %}
- daymonth: '{{ task_options.daymonth }}' - daymonth: '{{ task_options.daymonth }}'
{% endif %} {% endif %}
{% if 'month' in task_options %} {% if 'month' in task_options %}
- month: '{{ task_options.month }}' - month: '{{ task_options.month }}'
{% endif %} {% endif %}
{% if 'dayweek' in task_options %} {% if 'dayweek' in task_options %}
- dayweek: '{{ task_options.dayweek }}' - dayweek: '{{ task_options.dayweek }}'
{% endif %} {% endif %}
{% if 'commented' in task_options and task_options.commented %} {% if 'commented' in task_options and task_options.commented %}
- commented: True - commented: True
{% endif %} {% endif %}
{% if 'special' in task_options %} {% if 'special' in task_options %}
- special: '{{ task_options.special }}' - special: '{{ task_options.special }}'
{% endif %} {% endif %}
- identifier: '{{ task }}' - identifier: '{{ task }}'
{% if 'comment' in task_options %} {% if 'comment' in task_options %}
- comment: '{{ task_options.comment }}' - comment: '{{ task_options.comment }}'
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}

View File

@ -2,6 +2,6 @@
# vim: ft=sls # vim: ft=sls
include: include:
- cron.install - cron.install
- cron.config - cron.config
- cron.service - cron.service

View File

@ -4,5 +4,5 @@
{% from "cron/map.jinja" import cron_settings with context %} {% from "cron/map.jinja" import cron_settings with context %}
cron.install: cron.install:
pkg.installed: pkg.installed:
- name: {{ cron_settings.pkg }} - name: {{ cron_settings.pkg }}

View File

@ -2,23 +2,23 @@
# vim: ft=jinja # vim: ft=jinja
{% set os_family_map = salt['grains.filter_by']({ {% set os_family_map = salt['grains.filter_by']({
'RedHat': { 'RedHat': {
'pkg': 'cronie', 'pkg': 'cronie',
'service': 'crond', 'service': 'crond',
}, },
'Suse': { 'Suse': {
'pkg': 'cronie', 'pkg': 'cronie',
'service': 'cron', 'service': 'cron',
}, },
'Debian': { 'Debian': {
'pkg': 'cron', 'pkg': 'cron',
'service': 'cron', 'service': 'cron',
}, },
}, grain='os_family', merge=salt['pillar.get']('cron:lookup')) %} }, grain='os_family', merge=salt['pillar.get']('cron:lookup')) %}
{% set cron_settings = salt['pillar.get']( {% set cron_settings = salt['pillar.get'](
'cron', 'cron',
default=os_family_map, default=os_family_map,
merge=True merge=True
) )
%} %}

View File

@ -5,11 +5,11 @@
cron.service: 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: service.running:
- name: {{ cron_settings.service }} - name: {{ cron_settings.service }}
- enable: True - enable: True
{% else %} {% else %}
service.dead: service.dead:
- name: {{ cron_settings.service }} - name: {{ cron_settings.service }}
- enable: False - enable: False
{% endif %} {% endif %}

View File

@ -1,33 +1,33 @@
cron: cron:
enabled: True # Default enabled: True # Default
lookup: # Not needed, just if you want to use another cron program lookup: # Not needed, just if you want to use another cron program
pkg: 'cronie' pkg: 'cronie'
tasks: tasks:
task1: task1:
type: 'present' # Default type: 'present' # Default
name: 'echo test > /tmp/test' name: 'echo test > /tmp/test'
user: 'root' user: 'root'
minute: 0 minute: 0
hour: 0 hour: 0
daymonth: 7 daymonth: 7
month: 1 month: 1
dayweek: 6 dayweek: 6
comment: 'comment1' comment: 'comment1'
task2: task2:
type: 'absent' # To remove that crontask type: 'absent' # To remove that crontask
name: 'echo task2 > /tmp/test2' name: 'echo task2 > /tmp/test2'
user: 'root' user: 'root'
minute: 'random' minute: 'random'
hour: 1 hour: 1
task3: task3:
type: 'absent' type: 'absent'
name: 'echo task3 > /tmp/test3' name: 'echo task3 > /tmp/test3'
user: 'root' user: 'root'
special: '@hourly' special: '@hourly'
comment: 'comment3' comment: 'comment3'
task4: task4:
type: 'present' # run every 5 minutes type: 'present' # run every 5 minutes
user: 'root' user: 'root'
minute: '*/5' minute: '*/5'
hour: '*' hour: '*'
comment: 'comment4' comment: 'comment4'