Sample skeleton for Ansible module written in Perl -- how should I contribute?

Hi,

being a hardened Perl coder and Python novice, I prefer to use Perl to write my modules. I’ve gotten a simple skeleton that I use for this, that uses the auto-replacer code with the magic JSON string
("<<INCLUDE_ANSIBLE_MODULE_JSON_ARGS>>") and parses it (... probably) by transforming the JSON into a Perl datastructure, then using a reval within a Safe structure.

I think this would be of use to others -- but how best should I contribute it to Ansible? I am just not certain whereabouts it would fit into the current hierarchy. It's sort of related to the "Wrhiting Plugins" documentation -- but it is probably a bit big to include straight into that page.

So, any friendly suggestions?

thanks,

Uditha Desilva

I don’t know if you are aware, but there is already a Perl ‘module helper’

http://search.cpan.org/~mramberg/AnsibleModule-0.3/lib/AnsibleModule.pm

We don’t host Perl/Ruby/shell or other module helpers in the Ansible project itself, but we would be happy to reference such in our docs.

I did try that a while ago but it just didn’t work for me. The key difference, as far as I am concerned, is that my method allows the module (in the Ansible sense) to be pushed to all client systems just as the ones bundled with Ansible are, and will actually work on machines from RHEL5 upwards.

This can be seen at https://gist.github.com/udesilva/37de2a9b82112eb32086 – constructive feedback is welcome. :slight_smile:

Uditha.