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

Update mailserver mysql tasks as handlers

This commit is contained in:
L3D 2021-01-10 00:00:19 +01:00
parent 8d61560693
commit 3aca9dedd3
Signed by: l3d
GPG key ID: CD08445BFF4313D1
4 changed files with 22 additions and 21 deletions

View file

@ -0,0 +1,16 @@
---
- name: import mail database config
become: true
community.mysql.mysql_db:
name: vmail
encoding: 'utf8'
state: import
target: '/root/.mariadb_schema/config.sql'
- name: create database schema
become: true
community.mysql.mysql_db:
name: vmail
encoding: 'utf8'
state: import
target: '/root/.mariadb_schema/schema.sql'

View file

@ -17,6 +17,7 @@
copy:
dest: "/etc/mailname"
content: "{{ mailserver_domain }}"
mode: '0644'
- name: set own dns resolver
become: true

View file

@ -13,29 +13,13 @@
copy:
src: files/schema.sql
dest: /root/.mariadb_schema/schema.sql
register: mysqlschema
mode: '0644'
notify: create database schema
- name: Copy mail config
become: true
template:
src: templates/mysqlconfig.sql.j2
dest: /root/.mariadb_schema/config.sql
register: mysqlconfig
- name: create database schema
become: true
community.mysql.mysql_db:
name: vmail
encoding: 'utf8'
state: import
target: '/root/.mariadb_schema/schema.sql'
when: mysqlschema.changed
- name: Import database schema
become: true
community.mysql.mysql_db:
name: vmail
encoding: 'utf8'
state: import
target: '/root/.mariadb_schema/config.sql'
when: mysqlconfig.changed
mode: '0644'
notify: import mail database config

View file

@ -1,3 +1,3 @@
---
playbook_version_number: 33 # should be int
playbook_version_number: 34 # should be int
playbook_version_path: 'role-mailserver_roles-ansile_github.com.version'