bennojoy/mysql — pull request #19 by pjxiao (2014-06-22 06:37:24+00:00)
Title: Check if variable mysql_db is iterable

Execution a playbook is failed with following errors when I install MySQL without no databases.

```
TASK: [bennojoy.mysql | Copy the my.cnf file] *********************************
fatal: [127.0.0.1] => {'msg': "One or more undefined variables: 'str object' has no attribute 'name'", 'failed': True}
fatal: [127.0.0.1] => {'msg': "One or more undefined variables: 'str object' has no attribute 'name'", 'failed': True}
```

I set following variables in host_vars

```yaml
#host_vars/127.0.0.1
mysql_port: 3306 # The port for mysql server to listen
mysql_bind_address: "0.0.0.0" # The bind address for mysql server
mysql_root_db_pass: foo # The root DB password

mysql_db: none
mysql_users: none
mysql_repl_role: none
```

In `templates/my.cnf.Debian.j2`, for loop executed because `none` (str) is iterable.
I add condition to skip for loop when `mysql_db` is str or not iterable.