Commit 1ae76b1a authored by Matthew Smith's avatar Matthew Smith
Browse files

type is a required value

parent a6500979
......@@ -9,12 +9,14 @@ db_backup_crond:
- name: "mysql"
- name: "example"
cron:
command: "{{ db_backup_cron_default.command }} example"
command: "{{ db_backup_cron_default.command }} example -t mysql"
- name: "example2"
cron:
command: "{{ db_backup_cron_default.command }} -o '-Fc' -t 'pgsql' example2"
command: "{{ db_backup_cron_default.command }} example2 -o '-Fc' -t 'pgsql'"
minuite: 2
hour: 3
```
Database name (-d) and Type (-t) are required fields, db_backup_cron_default.command is default script path + -d
Note: the cron defaults are sensible but not infalible, best to be explicit in setting them if unsure
\ No newline at end of file
......@@ -8,7 +8,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
{% for job in db_backup_crond %}
{% if job.name is defined %}
{{ job.cron.minuite | default(db_backup_cron_default.minuite * loop.index ) }} {{ job.cron.hour | default(db_backup_cron_default.hour) }} {{ job.cron.day | default(db_backup_cron_default.day) }} {{ job.cron.month | default(db_backup_cron_default.month) }} {{ job.cron.dayofweek | default(db_backup_cron_default.dayofweek) }} {{ job.cron.user | default(db_backup_cron_default.user) }} {% if job.cron.command is defined %} {{ job.cron.command }} {% else %} {{ db_backup_cron_default.command }} {{ job.name }} {% endif %}
{{ job.cron.minuite | default(db_backup_cron_default.minuite * loop.index ) }} {{ job.cron.hour | default(db_backup_cron_default.hour) }} {{ job.cron.day | default(db_backup_cron_default.day) }} {{ job.cron.month | default(db_backup_cron_default.month) }} {{ job.cron.dayofweek | default(db_backup_cron_default.dayofweek) }} {{ job.cron.user | default(db_backup_cron_default.user) }} {% if job.cron.command is defined %} {{ job.cron.command }} {% else %} {{ db_backup_cron_default.command }} {{ job.name }} -t mysql {% endif %}
{% endif %}
{% endfor %}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment