I am having the same issue inserting crons into the root user’s crontab file according to this GitHub Issue
I am using ansible 2.3.0 … so shouldn’t my version include the commit that fixed this issue?
The exact error I am getting is:
`
fatal: [machine1]: FAILED! => {“changed”: false, “failed”: true, “module_stderr”: “Shared connection to 127.0.0.1 closed.\r\n”, “module_stdout”: “Traceback (most recent call last):\r\n File
"/tmp/ansible_TP4o_l/ansible_module_cron.py", line 773, in \r\n main()\r\n File "/tmp/ansible_TP4o_l/ansible_module_cron.py", line 741, in main\r\n crontab.write()\r\n Fil
e "/tmp/ansible_TP4o_l/ansible_module_cron.py", line 345, in write\r\n selinux.selinux_lsetfilecon_default(self.cron_file)\r\nOSError: [Errno 14] Bad address\r\n”, “msg”: "MODULE FAILURE
"}
`
What is happening now
-
The cron gets inserted into the root user’s crontab & produces that error above
-
I run the playbook again, and the error disappears (changes from fatal: to ok:)
-
I check root user’s crontab and the cron is there