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

zwischencommit - ausbau der mysqlconfig

This commit is contained in:
L3D 2021-01-08 01:16:01 +01:00
parent 93d67f6ffe
commit 343fad1b9f
Signed by: l3d
GPG key ID: CD08445BFF4313D1
2 changed files with 37 additions and 2 deletions

@ -1 +1 @@
Subproject commit d0a20bbc494fda7ccd9d0497e278a8e557d06c39 Subproject commit d132487b4216f4203390e40762f6a039a07307b5

View file

@ -1,4 +1,39 @@
{#- which table are we setting up #}
use vmail; use vmail;
{#-
setup mailserver domain
#}
insert into domains (domain) values ('{{ mailserver_domain }}'); insert into domains (domain) values ('{{ mailserver_domain }}');
insert into accounts (username, domain, password, quota, enabled, sendonly) values ('{{ mail_user }}', '{{ domain }}', '{{ mail_user_pass_hash }}', 2048, true, false); {#-
create all mail users, domains and enter password hashes...
CREATE TABLE `accounts` (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(64) NOT NULL,
`domain` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`quota` int unsigned DEFAULT '0',
`enabled` boolean DEFAULT '0',
`sendonly` boolean DEFAULT '0',
PRIMARY KEY (id),
UNIQUE KEY (`username`, `domain`),
FOREIGN KEY (`domain`) REFERENCES `domains` (`domain`)
);
mailserver_accounts:
- username: 'foo'
domain: 'example.com'
password_hash:
quota: '0'
enabled: true
sendonly: false
#}
{% for account in mailserver__accounts %}
insert into accounts (username, domain, password, quota, enabled, sendonly) values ('{{ account["username"] }}', '{{ account["domain"] }}', '{{ account["password_hash"] }}', {{ account["quota"]|default(0) | int }}, {{ account["enabled"] | default(true) | | ternary('true', 'false') }} , {{ account["sendonly"] | default(false) | | ternary('true', 'false' }});
{% endfor %}
{#-
create all mail aliases and stuff like that...
#}
insert into aliases (source_username, source_domain, destination_username, destination_domain, enabled) values ('alias', '{{ domain }}', '{{ mail_user }}', '{{ domain }}', true); insert into aliases (source_username, source_domain, destination_username, destination_domain, enabled) values ('alias', '{{ domain }}', '{{ mail_user }}', '{{ domain }}', true);