Mysql Module

Hello all!

This comes up a lot for my team, and I was wondering if others felt the same.

How does everyone feel about having a module to use to query Mysql databases? Possibly even at one point it could insert data as well.

Thoughts?

Does anyone know if there is one out there already that could be improved/merged into core?

would it make more sense as a lookup plugin?

To serve what purpose?

For querying data for use in the playbook (like we do now from files, etc).

mysql_db already has an “import” for updating/creating DBs.

That could definitely work… I could see use cases there to help with play orchestration.

I was also thinking of it from an orchestration stand point for users to be able to adhoc query a database using the ansible command. Make sense?

Example:

ansible all -m mysql -a “user=user password=password database=db1 query=select * from user”

It would then output in cli the results. The user wouldn’t have to use mysql monitor on the host.