mirror of
https://github.com/HanXHX/ansible-mysql.git
synced 2026-02-24 10:13:30 +07:00
mysql users with host management
This commit is contained in:
@@ -35,6 +35,7 @@ mysql_users:
|
||||
- name: 'kiki'
|
||||
password: '123'
|
||||
priv: hihi.*:ALL
|
||||
host: '%'
|
||||
```
|
||||
|
||||
Check "priv" syntax in [http://docs.ansible.com/mysql_user_module.html](mysql_user module documentation)
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
with_items: mysql_databases
|
||||
|
||||
- name: MYSQL_USER | Manages users...
|
||||
mysql_user: name={{ item.name }} password={{ item.password }} priv={{ item.priv }} state=present
|
||||
mysql_user: >
|
||||
name={{ item.name }}
|
||||
password={{ item.password }}
|
||||
priv={{ item.priv }}
|
||||
host={{ item.host | default('localhost') }}
|
||||
state=present
|
||||
with_items: mysql_users
|
||||
|
||||
|
||||
Reference in New Issue
Block a user