| Summary: | sysutils/ansible-sshjail: Ansible cannot find the module in its module path | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Ports & Packages | Reporter: | Mateusz Piotrowski <0mp> | ||||
| Component: | Individual Port(s) | Assignee: | Mateusz Piotrowski <0mp> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | CC: | 0mp, lcook | ||||
| Priority: | --- | Flags: | madpilot:
maintainer-feedback+
|
||||
| Version: | Latest | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
Mateusz Piotrowski
2021-05-16 12:49:31 UTC
I agree we can use another path for installation. I'm going to create a patch to this effect. Good point. Now, I'm wondering whether or not it would be useful introducing a new USES=ansible (for lack of better names) target to reduce some of the boilerplate and define a do-test target too. Maybe something like...
.if !defined (_INCLUDE_USES_ANSIBLE_MK)
_INCLUDE_USES_ANSIBLE_MK= yes
.if !${USES:Mpython*}
.include "${USESDIR}/python.mk"
.endif
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}ansible>0:sysutils/ansible@${PY_FLAVOR}
_ANSIBLE_PREFIX?= share/ansible
ANSIBLE_PLUGIN= ${_ANSIBLE_PREFIX}/plugins
ANSIBLE_MOD= ${ANSIBLE_PLUGIN}/modules
.if !target(do-test):
# Foo, baz
.endif
.endif
...in Mk/Uses/ansible.mk. Thoughts?
Created attachment 225011 [details]
ansble-base patch
I've made some tests and noticed the ansible base uses the following:
${FIND} ${WRKSRC} -not -regex '${WRKSRC}/test/units/cli/galaxy/test_execute_list_collection.py' -type f -print0 | \
${XARGS} -0 ${REINPLACE_CMD} \
-e 's|/etc/ansible|${ETCDIR}|g' \
-e 's|/usr/share/ansible|${DATADIR}|g'
By using DATADIR it point the search paths to /usr/local/share/py38-ansible-base/plugins which looks wrong. also this causes this substitution to create a different path than the one in the ansible port. Upstream code shown they are intended to be the same.
So I created the attached patch to address this and put back the original search path
Regarding adding a uses it looks like a good idea, but first we should correct the search path and then make such USES point to it.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=c8e37b455176cb3c016a50c671226a9d88f89570 commit c8e37b455176cb3c016a50c671226a9d88f89570 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-05-17 09:59:21 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-05-17 09:59:21 +0000 sysutils/py-ansible-*: Fix DATADIR for Ansible plugins All the Ansible plugins assume that the Ansible DATADIR is ${PREFIX}/share/${PYTHON_PKGNAMEPREFIX}ansible instead of ${PREFIX}/share/${PYTHON_PKGNAMEPREFIX}ansible-base or ${PREFIX}/share/${PYTHON_PKGNAMEPREFIX}ansible-core. This patch sets the DATADIR back to its historical value. It's based on a patch provided by madpilot. PR: 255920 Reported by: madpilot sysutils/py-ansible-base/Makefile | 4 +++- sysutils/py-ansible-core/Makefile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (In reply to Guido Falsi from comment #3) I've modified the patch a bit and also updated sysutils/py-ansible-core. I'm almost done with ansible.mk. I'll keep you posted. (In reply to Lewis Cook from comment #2) I've published my ansible.mk on phabricator: https://reviews.freebsd.org/D30312 I'll close this PR as the modules should be working again. ansible.mk is just something extra we are adding to the framework. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=92939bfde271f881e76fdb94ee5047271d2d1b43 commit 92939bfde271f881e76fdb94ee5047271d2d1b43 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-05-17 11:51:15 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-05-17 13:38:41 +0000 Add USES=ansible for Ansible ports The purpose of this new USES file is to provide a central place for setting Ansible paths for modules and plugins. Perhaps in the future we will extend to reduce boilerplate code in existing Ansible-related ports. PR: 255920 Reported by: lcook Reviewed by: madpilot Differential Revision: https://reviews.freebsd.org/D30312 Mk/Uses/ansible.mk (new) | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) |