mirror of
https://github.com/DO1JLR/ansible_playbook_servers.git
synced 2024-09-14 19:53:56 +02:00
40 lines
810 B
YAML
40 lines
810 B
YAML
|
---
|
||
|
- 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
|