Needed to create seven databases, for each database you need one user with the same name as the database.
db_names:
- keystone
- neutron
- glance
- placement
- nova
- nova_api
- nova_cell0
- name: Create user with password
mysql_user:
login_unix_socket: "{{ mariadb_login_unix_socket }}"
login_user: root
login_password: "{{ mysql_root_pass }}"
state: present
name: "{{ db_names }}"
password: "{{ mysql_root_pass }}"
update_password: always
priv:
"{{ db_names }}.*:ALL,GRANT"
At the moment, a row is being created in the database with all the names in one row.
You could use loop like this: