|
Link Here
|
|
|
1 |
commit b5e012b47fa9e242a38c3f66678aa2f47946a9c9 |
| 2 |
Author: Dmitry Marakasov <amdmi3@amdmi3.ru> |
| 3 |
Date: Thu May 26 17:37:28 2016 +0300 |
| 4 |
|
| 5 |
Fix crontab argument order for writing |
| 6 |
|
| 7 |
Currently, when writing user's crontab, ansible calls |
| 8 |
|
| 9 |
crontab <file> -u <user> |
| 10 |
|
| 11 |
This is incorrect according to crontab(1) on both FreeBSD and Linux, |
| 12 |
which suggest that file argument should be the last. |
| 13 |
|
| 14 |
At least on FreeBSD, this leads to incorrect cron module bahavior which |
| 15 |
writes to root's crontab instead of users's |
| 16 |
|
| 17 |
diff --git system/cron.py system/cron.py |
| 18 |
index ab97606..b9f0940 100644 |
| 19 |
--- lib/ansible/modules/core/system/cron.py |
| 20 |
+++ lib/ansible/modules/core/system/cron.py |
| 21 |
@@ -488,7 +488,7 @@ class CronTab(object): |
| 22 |
return "chown %s %s ; su '%s' -c '%s %s'" % (pipes.quote(self.user), pipes.quote(path), pipes.quote(self.user), CRONCMD, pipes.quote(path)) |
| 23 |
else: |
| 24 |
user = '-u %s' % pipes.quote(self.user) |
| 25 |
- return "%s %s %s" % (CRONCMD , pipes.quote(path), user) |
| 26 |
+ return "%s %s %s" % (CRONCMD , user, pipes.quote(path)) |
| 27 |
|
| 28 |
|
| 29 |
|