Bug 206656

Summary: sysutils/ansible: add dependency on py-netaddr
Product: Ports & Packages Reporter: Dmitry Marakasov <amdmi3>
Component: Individual Port(s)Assignee: Dmitry Marakasov <amdmi3>
Status: Closed FIXED    
Severity: Affects Some People CC: lifanov
Priority: --- Keywords: easy, needs-qa, patch
Version: LatestFlags: amdmi3: maintainer-feedback+
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch
none
Patch none

Description Dmitry Marakasov freebsd_committer freebsd_triage 2016-01-27 00:36:53 UTC
Created attachment 166165 [details]
Patch

Ansible contains ipaddr Jinja2 filter:
https://docs.ansible.com/ansible/playbooks_filters_ipaddr.html

However it requires py-netaddr to run, otherwise:

fatal: [myhost]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleFilterError: ERROR! The ipaddr filter requires python-netaddr be installed on the ansible controller"}

So add py-netaddr to the dependency list.

Note that there could be more hidden dependencies on other python modules. These dependencies could be also made optional in the port.
Comment 1 Nikolai Lifanov 2016-01-27 03:01:46 UTC
Hi! I'm a bit hesitant to add dependencies that enable specific Ansible features.
In this specific case, the error message is specific about what is missing.
We already depend on more than upstream setup.py specifies, and to provide
coverage for core and extra modules, we would need to depend on things like
py-boto and other heavy dependencies, not to mention OpenStack libraries, some
of which haven't even be ported.

Having said this, adding py-netaddr makes sense and I approve this patch.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2016-01-27 03:14:28 UTC
Reporter is Committer, assign accordingly
Comment 3 Dmitry Marakasov freebsd_committer freebsd_triage 2016-01-27 13:42:21 UTC
Created attachment 166187 [details]
Patch

IMO all possible dependencies should be listed, but as optionals and possibly disabled by default (heavy ones at least). If there's demand, slave port(s) may be added with different options sets (like vim/vim-lite), and when flavors are at last introduced that'll be even better.

Anyway I've changed the patch to make dependency optional (enabled be default as it's not the heavy one). While here, use options target helper for EXAMPLES. What do you think?
Comment 4 Nikolai Lifanov 2016-01-27 14:00:14 UTC
This change looks good to me for now. Long-term, once all outstanding issues with sysutils/ansible are resolved and I obsolete and remove sysutils/ansible1, I will work on a port with full dependencies and a -lite variety.
Comment 5 Dmitry Marakasov freebsd_committer freebsd_triage 2016-01-27 14:49:46 UTC
Great, thank you!
Comment 6 commit-hook freebsd_committer freebsd_triage 2016-01-27 14:50:16 UTC
A commit references this bug:

Author: amdmi3
Date: Wed Jan 27 14:49:45 UTC 2016
New revision: 407360
URL: https://svnweb.freebsd.org/changeset/ports/407360

Log:
  - Add dependency on py-netaddr needed for ipaddr() filter
  - Switch to options helpers

  PR:		206656
  Submitted by:	amdmi3
  Approved by:	lifanov@mail.lifanov.com (maintainer)

Changes:
  head/sysutils/ansible/Makefile