This is rather rough and could use some feedback (and even upgrades to my Ruby) but I was talking to someone today who wanted to know how to write modules, even fact modules that take parameters, in Ruby.
So I made an example: https://github.com/ansible/ansible-for-rubyists/
Feedback welcome! Meant to be more conceptual than systems management based.
I hope this helps people understand how to write ansible extensions in other (dynamic, at least) languages.
Example is crystal clear.
However, instead of doing a ruby centric example, wouldn't it be nice to
have a rosetta stone repos with examples in many languages ?
M
Yeah, that’s not a bad idea. I can see this folding into Ansible-examples with a Perl example too at some point, and an example of how to do the same in Bash (but probably not using JSON inputs).
Ruby seemed to be the most popular one people wanted to use, and had some extra interest because
a couple of major configuration management systems happen to be written in it
I believe people will be able to adapt things to their needs.
Perhaps in the not-too-distant future.
Will there be a change to the policy that all modules in the Ansible release have to be written in Python ?
Nope, ansible-core modules still need to be a Python.
This is just to demonstrate things to folks who are interested in Ruby development.