add .my.cnf
This commit is contained in:
parent
2c178f9e9c
commit
8a7b7f0b81
2 changed files with 14 additions and 0 deletions
7
mysql/files/mysql_secure-installation-my.conf.j2
Normal file
7
mysql/files/mysql_secure-installation-my.conf.j2
Normal file
|
@ -0,0 +1,7 @@
|
|||
[client]
|
||||
user=root
|
||||
password={{ MYSQL_ROOT_PASSWORD }}
|
||||
|
||||
[mysql]
|
||||
user=root
|
||||
password={{ MYSQL_ROOT_PASSWORD }}
|
|
@ -14,6 +14,13 @@
|
|||
- 127.0.0.1
|
||||
- ::1
|
||||
- localhost
|
||||
- name: Set ~/.my.cnf file
|
||||
template:
|
||||
- src: files/mysql_secure-installation-my.conf.j2
|
||||
- dest: /root/.my.cnf
|
||||
- mode: '0600'
|
||||
vars:
|
||||
MYSQL_ROOT_PASSWORD: "{{mysql_root_password}}"
|
||||
- name: Delete anonymous MySQL user
|
||||
mysql_user: name="" host={{item}} state=absent
|
||||
with_items:
|
||||
|
|
Loading…
Reference in a new issue