Automatic mysql_secure_installation
This commit is contained in:
parent
f9232d32b2
commit
b291330bc9
1 changed files with 19 additions and 0 deletions
|
@ -7,3 +7,22 @@
|
||||||
- mariadb
|
- mariadb
|
||||||
- mariadb-client
|
- mariadb-client
|
||||||
- mariadb-openrc
|
- mariadb-openrc
|
||||||
|
- name: Update MariaDB root password
|
||||||
|
mysql_user: name=root host={{item}} password={{mysql_root_password}}
|
||||||
|
with_items:
|
||||||
|
- 127.0.0.1
|
||||||
|
- ::1
|
||||||
|
- localhost
|
||||||
|
- name: Delete anonymous MySQL user
|
||||||
|
mysql_user: name="" host={{item}} state=absent
|
||||||
|
with_items:
|
||||||
|
- localhost
|
||||||
|
- "{{ansible_nodename}}"
|
||||||
|
- name: Delete Hostname based MySQL user
|
||||||
|
mysql_user: name=root host="{{ansible_nodename}}" state=absent
|
||||||
|
- name: Remove MySQL test database
|
||||||
|
mysql_db:
|
||||||
|
name: test
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue