Blog by Daniel Hauck. Sysadmin, Developer, Blogger.

As I have received multiple requests now, I decided to make a little bonus for you 😉

It seems like a lot of you preferring MySQL over PostgreSQL. I don’t understand why, but that’s another topic 😉

You can do it!

It isn’t that hard. But let’s go through it, step by step.

First, as usual, create your role:

We will reuse our apps config from the Postgres database here, so nothing to change in case of the group_vars/all file.

Now it’s time to install the MySQL server itself, therefore create a main.yml as usual:

As with Postgres, to create databases and users, we need to install the Python MySQL binding, let’s to it.

Last but not least we will finally create our users and their databases:

Test it!

Get rid of the Postgres role in provisioning/playbook.yml and replace it with

Now run your provisioning again, and you are ready to use MySQL.

Ain’t that easy? See you next time!

There are no comments.

Leave a Reply