Nguyễn Vi:
Hi everyone
I have a question. How does we set a variable for database in mysql_user module? Because I can’t see any database when I login mysql with user demo
---
- hosts: db_and_web_srv_1
vars:
- db: demo
- user_db: demo
- password: abcdef
tasks:
- name: Create database
mysql_db: name={{ db }} state=present
- name: Create user database
mysql_user:
name: '{{ user_db }}'
password: '{{ password }}'
priv:
"'{{ db }}'.*": "ALL,GRANT"
state: present