Files
wm-mysql/roles/mysql/tasks/mysql_user.yml
Marcel Nijenhof cff00f04c7 Eerste grote update:
- Wissen standaard accounts
 - Zetten root password
 - Aanmaken databases
 - Aanmaken gebruikers per database
 - Lege files klaar zetten voor backup, slave, config
2021-05-06 14:46:09 +02:00

30 lines
709 B
YAML

---
- name: Remove remote root account (localhost-only)
community.mysql.mysql_user:
name: root
host: "{{ ansible_fqdn }}"
state: absent
- name: Remove remote root account (::1)
community.mysql.mysql_user:
name: root
host: ::1
state: absent
- name: Remove remote root account (127.0.0.1)
community.mysql.mysql_user:
name: root
host: 127.0.0.1
state: absent
- name: Set root password for root@localhost
community.mysql.mysql_user:
name: root
host: localhost
password: "{{ mysql_root_password }}"
state: present
- name: Create my.cnf
ansible.builtin.template:
src: my.cnf.j2
dest: /root/.my.cnf
owner: root
group: root
mode: 0600