edit shopware database step

master
parent 93a4c44a32
commit eb4c336583
  1. 6
      my.cnf
  2. 40
      tasks/shopware.yml

@ -21,6 +21,6 @@
# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
[client]
user="root"
password="rootpass"
#[client]
user=root
password=rootpass

@ -25,14 +25,50 @@
- name: update mariadb root user
mysql_user:
login_host: "{{shopware_db_username}}"
login_unix_socket: /var/run/mysqld/mysqld.sock
#login_host: "{{shopware_db_username}}"
login_user: "root"
login_password: "{{shopware_db_pass}}"
login_password: "rootpass"
name: "{{shopware_db_username}}"
password: "{{shopware_db_pass}}"
check_implicit_admin: yes
state: present
- name: Make sure service is started and enabled
systemd:
name: mariadb
state: started
enabled: yes
- name: Delete all anonymous SQL user accounts
mysql_user:
user: ""
host_all: yes
state: absent
- name: Remove the SQL test database
mysql_db:
db: "test"
state: absent
- name: Change root user password on first run
mysql_user:
login_user: root
login_password: ''
name: root
password: "{{ shopware_db_pass }}"
priv: "*.*:ALL,GRANT"
host: "{{ item }}"
with_items:
- "{{ ansible_hostname }}"
- "127.0.0.1"
- "::1"
- "localhost"
- name: Make sure user exists
shell:
cmd: "mysql -uroot -p{{ shopware_db_pass }} -e\"CREATE USER IF NOT EXISTS '{{ shopware_db_username }}'@'localhost' IDENTIFIED BY '{{ shopware_db_pass }}' REQUIRE SSL;\" -N -B"
register: result
- name: Create Database
become: yes

Loading…
Cancel
Save