Fxies
This commit is contained in:
@@ -47,6 +47,16 @@
|
||||
- name: Flush handlers (reinicia MySQL abans de crear usuaris)
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
||||
# ✅ Fix Ubuntu 24.04: canviar auth_socket per mysql_native_password
|
||||
- name: Canviar autenticació de root a mysql_native_password
|
||||
ansible.builtin.shell: |
|
||||
mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '{{ db_root_password }}';"
|
||||
mysql -u root -e "FLUSH PRIVILEGES;"
|
||||
args:
|
||||
executable: /bin/bash
|
||||
become: yes
|
||||
ignore_errors: yes
|
||||
|
||||
# ✅ Crear /root/.my.cnf perquè community.mysql pugui autenticar-se
|
||||
- name: Crear /root/.my.cnf amb credencials de root
|
||||
ansible.builtin.copy:
|
||||
|
||||
3
roles/database/templates/my.cnf.j2
Normal file
3
roles/database/templates/my.cnf.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
[client]
|
||||
user=root
|
||||
password={{ db_root_password }}
|
||||
Reference in New Issue
Block a user