Index: head/sysutils/ansible/Makefile =================================================================== --- head/sysutils/ansible/Makefile (revision 425743) +++ head/sysutils/ansible/Makefile (revision 425744) @@ -1,67 +1,70 @@ # Created by: Nikolai Lifanov # $FreeBSD$ PORTNAME= ansible PORTVERSION?= 2.2.0.0 +PORTREVISION?= 1 CATEGORIES= sysutils python MASTER_SITES= http://releases.ansible.com/ansible/ MAINTAINER= lifanov@mail.lifanov.com COMMENT= Radically simple IT automation LICENSE= GPLv3+ LICENSE_FILE= ${WRKSRC}/COPYING RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml \ ${PYTHON_PKGNAMEPREFIX}pycrypto>0:security/py-pycrypto \ ${PYTHON_PKGNAMEPREFIX}paramiko>0:security/py-paramiko \ ${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2 + +EXTRA_PATCHES?= ${FILESDIR}/extra-patch-872594b NO_ARCH= yes USES?= cpe python shebangfix USE_PYTHON= autoplist distutils python_CMD= ${LOCALBASE}/bin/python SHEBANG_FILES+= lib/ansible/modules/core/*/*.py \ lib/ansible/modules/core/*/*/*.py \ lib/ansible/modules/extras/*/*.py \ lib/ansible/modules/extras/*/*/*.py CPE_VENDOR= ansibleworks SUB_FILES= pkg-message PLIST_FILES+= man/man1/ansible-doc.1.gz \ man/man1/ansible-galaxy.1.gz \ man/man1/ansible-playbook.1.gz \ man/man1/ansible-pull.1.gz \ man/man1/ansible-vault.1.gz \ man/man1/ansible.1.gz PORTEXAMPLES= ansible.cfg hosts OPTIONS_DEFINE= DOCS EXAMPLES NETADDR OPTIONS_DEFAULT=NETADDR NETADDR_DESC= Dependency on py-netaddr for ipaddr() filter NETADDR_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}netaddr>0:net/py-netaddr post-patch: .for f in bin/* docs/man/man1/* examples/* lib/ansible/*.py \ lib/ansible/*/*.py lib/ansible/*/*/*.py lib/ansible/*/*/*/*.py @${REINPLACE_CMD} -e 's|/etc/ansible|${ETCDIR}|' ${WRKSRC}/${f} .endfor .for f in docs/man/man1/* examples/* lib/ansible/*.py lib/ansible/*/*.py @${REINPLACE_CMD} -e 's|/usr/share/ansible|${DATADIR}|' ${WRKSRC}/${f} .endfor post-install: @${MKDIR} ${STAGEDIR}${MAN1PREFIX}/man/man1 ${INSTALL_MAN} ${WRKSRC}/docs/man/man1/*.1 \ ${STAGEDIR}${MAN1PREFIX}/man/man1 post-install-EXAMPLES-on: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/examples/ansible.cfg ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/examples/hosts ${STAGEDIR}${EXAMPLESDIR} .include Index: head/sysutils/ansible/files/extra-patch-872594b =================================================================== --- head/sysutils/ansible/files/extra-patch-872594b (nonexistent) +++ head/sysutils/ansible/files/extra-patch-872594b (revision 425744) @@ -0,0 +1,41 @@ +From 872594b49a69a1f3795e0de3f7cf0194b6bdfd53 Mon Sep 17 00:00:00 2001 +From: Michael Scherer +Date: Sun, 23 Oct 2016 19:24:00 +0200 +Subject: [PATCH] Make service work when the service is not present in rc.conf + +After installing a package from the ports collection on a +fresh FreeBSD 11.0, Ansible was unable to enable it, failing with +"unable to get current rcvar value". Debugging showed that sysrc +didn't see the variable from /usr/local/etc/rc.d/myservice, but +adding the value was working. + +So we will just fallback to the default value if we can't find it. +--- + system/service.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git system/service.py system/service.py +index d216e68..c8781b1 100644 +--- lib/ansible/modules/core/system/service.py ++++ lib/ansible/modules/core/system/service.py +@@ -988,7 +988,7 @@ def service_enable(self): + # and hope for the best. + for rcvar in rcvars: + if '=' in rcvar: +- self.rcconf_key = rcvar.split('=')[0] ++ self.rcconf_key, default_rcconf_value = rcvar.split('=', 1) + break + + if self.rcconf_key is None: +@@ -997,8 +997,10 @@ def service_enable(self): + if self.sysrc_cmd: # FreeBSD >= 9.2 + + rc, current_rcconf_value, stderr = self.execute_command("%s -n %s" % (self.sysrc_cmd, self.rcconf_key)) ++ # it can happen that rcvar is not set (case of a system coming from the ports collection) ++ # so we will fallback on the default + if rc != 0: +- self.module.fail_json(msg="unable to get current rcvar value", stdout=stdout, stderr=stderr) ++ current_rcconf_value = default_rcconf_value + + if current_rcconf_value.strip().upper() != self.rcconf_value: + Property changes on: head/sysutils/ansible/files/extra-patch-872594b ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property