1
0
Fork 0
mirror of https://github.com/DO1JLR/ansible_playbook_servers.git synced 2024-09-14 19:53:56 +02:00
ansible_playbook_servers/roles/mailserver_preperation/tasks/mariadb.yml

40 lines
810 B
YAML
Raw Normal View History

2021-01-03 01:01:18 +01:00
---
- name: create database schema store dir
become: true
file:
path: /root/.mariadb_schema
state: directory
mode: '0755'
owner: root
group: root
- name: Copy database schema
become: true
copy:
src: files/schema.sql
dest: /root/.mariadb_schema/schema.sql
register: mysqlschema
- name: Copy mail config
become: true
template:
src: templates/mysqlconfig.sql.j2
dest: /root/.mariadb_schema/config.sql
register: mysqlconfig
- name: Import database schema
become: true
mssql_db:
name: vmail
state: import
target: '/root/.mariadb_schema/schema.sql'
when: mysqlschema.changed
- name: Import database schema
become: true
mssql_db:
name: vmail
state: import
target: '/root/.mariadb_schema/config.sql'
when: mysqlconfig.changed