1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-29 05:38:00 +00:00

sysutils/ansible: add patch to fix cron module

PR:		209789
Submitted by:	Dmitry Marakasov <amdmi3@FreeBSD.org>
Submitted by:	Nikolai Lifanov <lifanov@mail.lifanov.com> (maintainer)
Approved by:	bdrewery (implicit, mentor)
This commit is contained in:
Brad Davis 2016-06-11 00:49:52 +00:00
parent 4cd5490aa4
commit 03da36a8f4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=416699
2 changed files with 32 additions and 0 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= ansible
PORTVERSION?= 2.1.0.0
PORTREVISION?= 1
CATEGORIES= sysutils python
MASTER_SITES= http://releases.ansible.com/ansible/
@ -17,6 +18,8 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml \
${PYTHON_PKGNAMEPREFIX}paramiko>0:security/py-paramiko \
${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2
EXTRA_PATCHES?= ${FILESDIR}/extra-patch-b5e012b
NO_ARCH= yes
USES= cpe python:2 shebangfix
USE_PYTHON= autoplist distutils

View File

@ -0,0 +1,29 @@
commit b5e012b47fa9e242a38c3f66678aa2f47946a9c9
Author: Dmitry Marakasov <amdmi3@amdmi3.ru>
Date: Thu May 26 17:37:28 2016 +0300
Fix crontab argument order for writing
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
diff --git system/cron.py system/cron.py
index ab97606..b9f0940 100644
--- lib/ansible/modules/core/system/cron.py
+++ lib/ansible/modules/core/system/cron.py
@@ -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))