Ansible is written in Python, but you can write modules in any language.  Here are some Ruby examples to get you started.