Blog by Daniel Hauck. Sysadmin, Developer, Blogger.

PHP / Symfony Development Environment with Vagrant and Ansible – BONUS: MySQL

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

It seems like a lot of you prefering mysql over postgresql. I don’t understand why, but that’s another topic 😉

You can do it!

Actually it ain’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 provisiong again, and you are ready to use mysql.

Ain’t that easy? See you next time!

Small Projects for Programming Beginners

I get the same questions over and over again, which is not a bad thing, but I want to give an answer here. Beginners always send me questions on what small projects they should do to learn fundamentals of a programming language. So I will create a little section here, with small challenges, you can try yourself to learn the basics of any programming language instead of just printing out “Hello World” to the screen.