FreeBSD Bugzilla – Attachment 176781 Details for
Bug 214322
sysutils/ansible: backport 872594b from ansible-modules-core
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
sysutils/ansible: backport 872594b
ansible-backport-872594b.diff (text/plain), 2.89 KB, created by
Nikolai Lifanov
on 2016-11-08 13:42:31 UTC
(
hide
)
Description:
sysutils/ansible: backport 872594b
Filename:
MIME Type:
Creator:
Nikolai Lifanov
Created:
2016-11-08 13:42:31 UTC
Size:
2.89 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 425738) >+++ Makefile (working copy) >@@ -3,6 +3,7 @@ > > PORTNAME= ansible > PORTVERSION?= 2.2.0.0 >+PORTREVISION?= 1 > CATEGORIES= sysutils python > MASTER_SITES= http://releases.ansible.com/ansible/ > >@@ -17,6 +18,8 @@ > ${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 >Index: files/extra-patch-872594b >=================================================================== >--- files/extra-patch-872594b (nonexistent) >+++ files/extra-patch-872594b (working copy) >@@ -0,0 +1,41 @@ >+From 872594b49a69a1f3795e0de3f7cf0194b6bdfd53 Mon Sep 17 00:00:00 2001 >+From: Michael Scherer <misc@redhat.com> >+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: 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
lifanov
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 214322
:
176780
| 176781