Updates to many roles, including main user role to allow setting an alternate home directory
This commit is contained in:
35
db/mysql-percona/tasks/secure.yml
Normal file
35
db/mysql-percona/tasks/secure.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
- name: "Copy .my.cnf file into the root home folder"
|
||||
template:
|
||||
src: root-my-cnf.j2
|
||||
dest: /root/.my.cnf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
|
||||
- name: "Set the root password"
|
||||
mysql_user:
|
||||
name: root
|
||||
host: "{{ item }}"
|
||||
password: "{{ mysql_root_password }}"
|
||||
check_implicit_admin: yes
|
||||
state: present
|
||||
with_items:
|
||||
- "{{ ansible_hostname }}"
|
||||
- "127.0.0.1"
|
||||
- "::1"
|
||||
- "localhost"
|
||||
|
||||
- name: "Ensure anonymous users are not in the database"
|
||||
mysql_user:
|
||||
name: ''
|
||||
host: "{{ item }}"
|
||||
state: absent
|
||||
with_items:
|
||||
- "{{ ansible_hostname }}"
|
||||
- "localhost"
|
||||
|
||||
- name: "Remove the test database"
|
||||
mysql_db:
|
||||
name: test
|
||||
state: absent
|
||||
Reference in New Issue
Block a user