How do I use a SQL database as an inventory source in Ansible Tower?

Posted on

My organization is currently setting up Ansible Tower 3.8.5 on Red Hat Enterprise Linux 7.9. (We're in the process of moving to Red Hat 8, but big companies move slowly.) I'd like to pull from our existing CMDB instead of maintaining inventory manually. Our DBA has set up a view that contains all relevant information on all our servers. I've been able to use the pymssql module to successfully query the database from a Python script (using Python 3.6.8). How can I pull the data from the database and convert it to a format Tower can use? Is there an existing plugin or script, or would I have to write my own? I'm very new to Tower, and I'm trying to learn it as I go.

Responses