vars:
crontab_commands:
- "0 * * * * ls / >> /tmp/ls.log"
tasks:
- name: Add cron jobs
cron:
minute: "{{ item.split()[0] }}"
hour: "{{ item.split()[1] }}"
day: "{{ item.split()[2] }}"
month: "{{ item.split()[3] }}"
weekday: "{{ item.split()[4] }}"
job: "{{ item.split()[5:] | join(' ') }}"
with_items:
- "{{ crontab_commands }}"
when: crontab_commands is defined
В чем смысл подобного?
Обсуждают сегодня