Article 5C5BJ ansible - adding crontab entry

ansible - adding crontab entry

by
czezz
from LinuxQuestions.org on (#5C5BJ)
Im having a problem with ansible while adding entry to crontab for user: user1.
Entry is added, however for some reason between execution time and a command, user1 is added.
Please see following result:
Code:#Ansible: script1.sh
0 1 * * 1 user1 /mnt/sync/script1.shDoes anyone understand what am I doing wrong?
I tried to kick out line: user: user1 but then execution fails.

This is the code of: tasks/script1.yml
Code:---

- name: create file and add crontab entry
file:
path: "/mnt/sync/script1.sh"
state: directory
mode: '0755'

- name: upload script1.sh
copy:
src: "script1.sh"
dest: "/mnt/sync/script1.sh"
mode: 755
owner: user1
group: group1
backup: yes

- name: cron job to for script1.sh
cron:
name: script1
weekday: "1"
hour: "1"
cron_file: "/var/spool/cron/user1"
user: user1
job: "/mnt/sync/script1.sh"latest?d=yIl2AUoC8zA latest?i=Y188BzlGoQw:Z_eM8nTnPAo:F7zBnMy latest?i=Y188BzlGoQw:Z_eM8nTnPAo:V_sGLiP latest?d=qj6IDK7rITs latest?i=Y188BzlGoQw:Z_eM8nTnPAo:gIN9vFwY188BzlGoQw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments