mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Fix crontab argument order for writing (#3750)
Currently, when writing user's crontab, ansible calls
crontab <file> -u <user>
This is incorrect according to crontab(1) on both FreeBSD and Linux,
which suggest that file argument should be the last.
At least on FreeBSD, this leads to incorrect cron module bahavior which
writes to root's crontab instead of users's
This commit is contained in:
committed by
Matt Clay
parent
3ae6583510
commit
13d7a61160
@@ -488,7 +488,7 @@ class CronTab(object):
|
||||
return "chown %s %s ; su '%s' -c '%s %s'" % (pipes.quote(self.user), pipes.quote(path), pipes.quote(self.user), CRONCMD, pipes.quote(path))
|
||||
else:
|
||||
user = '-u %s' % pipes.quote(self.user)
|
||||
return "%s %s %s" % (CRONCMD , pipes.quote(path), user)
|
||||
return "%s %s %s" % (CRONCMD , user, pipes.quote(path))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user