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 - name: install python-mysql
package: package:
name: "{{ item }}" name: python3-pymysql
state: present state: present
loop:
- python-pymysql - name: check if .my.cnf file exists
- python3-pymysql stat:
path: /root/.my.cnf
register: dot_my_cnf
- name: root password - 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: mysql_user:
login_user: root login_user: root
host: "{{ item }}" host: "{{ item }}"
@@ -53,12 +69,6 @@
- "127.0.0.1" - "127.0.0.1"
- "::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 - name: scripted version of mysql_secure_installation
command: "{{ item }}" command: "{{ item }}"
args: args: