making changes to mysql db

master
parent d000f2e9a7
commit 93a4c44a32
  1. 26
      my.cnf
  2. 20
      tasks/shopware.yml

@ -0,0 +1,26 @@
# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
[client]
user="root"
password="rootpass"

@ -18,13 +18,31 @@
- python3-pymysql
state: latest
# TODO: Add my.cnf
- name: Copy my.cnf
copy:
src: ../my.cnf
dest: /etc/mysql/my.cnf
- name: update mariadb root user
mysql_user:
login_host: "{{shopware_db_username}}"
login_user: "root"
login_password: "{{shopware_db_pass}}"
name: "{{shopware_db_username}}"
password: "{{shopware_db_pass}}"
check_implicit_admin: yes
state: present
- name: Create Database
become: yes
community.mysql.mysql_db:
name: shopware
state: present
config_file: /etc/mysql/my.cnf
- name: Create user with password, all database privileges and 'WITH GRANT OPTION' shopware database
become: yes
community.mysql.mysql_user:
state: present
name: "{{shopware_db_username}}"

Loading…
Cancel
Save