Solved authentification bug and added draft for socket

This commit is contained in:
2024-01-03 18:01:58 +01:00
parent 27b5b3a74b
commit 8eed734ad0
4 changed files with 26 additions and 14 deletions

View File

@@ -4,6 +4,11 @@
state: present
when: run_once_docker_mariadb is not defined
- name: Create a volume for MariaDB socket
docker_volume:
name: mariadb_socket
when: run_once_docker_mariadb is not defined
- name: install MariaDB
docker_container:
name: central-mariadb
@@ -15,39 +20,42 @@
networks:
- name: central_mariadb_network
volumes:
- database:/var/lib/mysql
- central_mariadb_database:/var/lib/mysql
- central_mariadb_socket:/var/run/mysqld
published_ports:
- "127.0.0.1:3306:3306"
- "127.0.0.1:3306:3306" # can be that this will be removed if all applications use sockets
command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW" #for nextcloud
when: run_once_docker_mariadb is not defined
- name: wait for availability of mariadb
wait_for:
host: "127.0.0.1"
port: "3306"
delay: 0
timeout: 120
when: run_once_docker_mariadb is not defined
- name: install python-mysqlclient
pacman:
name: python-mysqlclient
state: present
when: run_once_docker_mariadb is not defined
- name: wait for database
wait_for:
host: 127.0.0.1
port: 3306
delay: 10
timeout: 300
when: run_once_docker_mariadb is not defined
- name: create database
mysql_db:
name: "{{database_databasename}}"
name: "{{ database_databasename }}"
state: present
login_user: root
login_password: "{{central_mariadb_root_password}}"
login_password: "{{ central_mariadb_root_password }}"
login_host: 127.0.0.1
login_port: 3306
- name: create database user
mysql_user:
name: "{{database_username}}"
password: "{{database_password}}"
host: "%"
priv: '{{database_databasename}}.*:ALL'
state: present
login_user: root