I've just written a Perl module which I'm happy to contribute back to
the community, e.g., in community.general, if people think it would be
useful to others and appropriate to include there, but I'm not sure
whether it is. I wanted to run it past the folks here and get others'
opinions, since I know there is a cost to shipping any new code in a
project so the benefit has to outweigh the cost.
The problem I was trying to solve is this: I have a bunch of Perl
scripts that use a bunch of Perl modules, some of which are available as
OS package and some of which aren't and need to be installed directly
from CPAN. I strongly prefer to use the OS packages whenever possible,
since these are maintained by someone else and updated as needed. In
other words, I only want to install Perl modules from CPAN if they
aren't available in the OS.
The Perl module I wrote doesn't actually install modules. Instead, it
searches for them in dnf, yum, apt, and/or cpanm depending on what's
available on the target system and what search options the user
specifies, and returns state indicating requirements / packages that can
be installed with each package manager, along with a list of modules
that couldn't be found in any of the enabled sources.
The other clever thing about this module is that it expands dependencies
with cpanm and then circles back and checks the OS package managers for
those dependencies. In other words, if for example one of the Perl
modules you search for is only available in cpanm, and that module has
ten dependencies, and five of those dependencies are available from the
OS and the other five are only available from cpanm, then the result
returned by the module will tell you to install the five packages from
the OS and six from cpanm rather than saying to install all 11 from cpanm.
Does this sound sufficiently useful to people to consider adding it to a
community collection? Is there a more "Ansible way" to implement this
than I have?
For reference I've posted my current version of the code in a gist
<https://gist.github.com/jikamens/d3e90a63a025ea430956d53fe50a4a43>.
Thanks,
Jonathan Kamens
--
You received this message because you are subscribed to the Google Groups "Ansible
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-devel/fd98986a-f2cb-e37f-4d9c-6d91c73dcdd8%40kamens.us.