Ugly mariadb hack

This commit is contained in:
VC
2024-07-05 11:53:08 +02:00
parent 405fa506d3
commit 562047021d

View File

@@ -36,13 +36,29 @@
- name: install python-mysql
package:
name: "{{ item }}"
name: python3-pymysql
state: present
loop:
- python-pymysql
- python3-pymysql
- name: check if .my.cnf file exists
stat:
path: /root/.my.cnf
register: dot_my_cnf
- name: root password
mysql_user:
login_unix_socket: "/var/run/mysqld/mysqld.sock"
host: localhost
name: root
password: "{{ mariadb_root_pass }}"
when: dot_my_cnf.stat.exists == False
- name: put .my.cnf file
template:
src: dot.my.cnf.j2
dest: ~/.my.cnf
mode: '0600'
- name: root password (follow-up)
mysql_user:
login_user: root
host: "{{ item }}"
@@ -53,12 +69,6 @@
- "127.0.0.1"
- "::1"
- name: put .my.cnf file
template:
src: dot.my.cnf.j2
dest: ~/.my.cnf
mode: '0600'
- name: scripted version of mysql_secure_installation
command: "{{ item }}"
args: