mirror of
https://github.com/rubenhensen/k8scd.git
synced 2026-09-18 18:42:56 +02:00
Ansible config for hetzner mailserver
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
[server]
|
||||
hostname = "{{ stalwart_server_hostname }}"
|
||||
max-connections = {{ stalwart_server_max_connections }}
|
||||
{% if stalwart_acme_enabled %}
|
||||
tls.certificate = "acme"
|
||||
{% endif %}
|
||||
|
||||
{% for listener in stalwart_server_listeners %}
|
||||
[server.listener.{{ listener.name }}]
|
||||
bind = "{{ listener.bind }}"
|
||||
protocol = "{{ listener.protocol }}"
|
||||
{% for option_name, option_value in (listener.options | default({})).items() %}
|
||||
{{ option_name }} =
|
||||
{%- if option_value is string %} "{{ option_value }}"
|
||||
{%- elif option_value is boolean %} {{ option_value | lower }}
|
||||
{%- else %} {{ option_value }}
|
||||
{%- endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
{% if stalwart_acme_enabled %}
|
||||
[certificate.acme]
|
||||
type = "acme"
|
||||
provider = "letsencrypt"
|
||||
domains = [{% for d in stalwart_acme_domains %}"{{ d }}"{% if not loop.last %}, {% endif %}{% endfor %}]
|
||||
|
||||
[acme.letsencrypt]
|
||||
directory = "{{ stalwart_acme_directory }}"
|
||||
contact = ["{{ stalwart_acme_contact }}"]
|
||||
challenge = "tls-alpn-01"
|
||||
default = true
|
||||
{% endif %}
|
||||
|
||||
[storage]
|
||||
data = "{{ stalwart_storage_data }}"
|
||||
fts = "{{ stalwart_storage_fts }}"
|
||||
blob = "{{ stalwart_storage_blob }}"
|
||||
lookup = "{{ stalwart_storage_lookup }}"
|
||||
directory = "{{ stalwart_directory_type }}"
|
||||
|
||||
{% for store in stalwart_stores %}
|
||||
[store.{{ store.name }}]
|
||||
type = "{{ store.type }}"
|
||||
{% for option_name, option_value in (store.options | default({})).items() %}
|
||||
{{ option_name }} =
|
||||
{%- if option_value is string %} "{{ option_value }}"
|
||||
{%- elif option_value is boolean %} {{ option_value | lower }}
|
||||
{%- else %} {{ option_value }}
|
||||
{%- endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
[directory.{{ stalwart_directory_type }}]
|
||||
type = "{{ stalwart_directory_type }}"
|
||||
{% for option_name, option_value in stalwart_directory_options.items() %}
|
||||
{{ option_name }} =
|
||||
{%- if option_value is string %} "{{ option_value }}"
|
||||
{%- elif option_value is boolean %} {{ option_value | lower }}
|
||||
{%- else %} {{ option_value }}
|
||||
{%- endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% for tracer in stalwart_tracers %}
|
||||
[tracer.{{ tracer.type }}]
|
||||
type = "{{ tracer.type }}"
|
||||
{% for option_name, option_value in (tracer.options | default({})).items() %}
|
||||
{{ option_name }} =
|
||||
{%- if option_value is string %} "{{ option_value }}"
|
||||
{%- elif option_value is boolean %} {{ option_value | lower }}
|
||||
{%- else %} {{ option_value }}
|
||||
{%- endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
[authentication.fallback-admin]
|
||||
user = "{{ stalwart_fallback_admin_login }}"
|
||||
secret = "{{ stalwart_fallback_admin_password | ansible.builtin.password_hash(salt=stalwart_fallback_admin_password_salt, rounds=5000) }}"
|
||||
|
||||
{% for config in stalwart_additional_configs | default([]) %}
|
||||
[{{ config.name }}]
|
||||
{% for option_name, option_value in (config.options | default({})).items() %}
|
||||
{{ option_name }} =
|
||||
{%- if option_value is string %} "{{ option_value }}"
|
||||
{%- elif option_value is boolean %} {{ option_value | lower }}
|
||||
{%- else %} {{ option_value }}
|
||||
{%- endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=Stalwart Mail Server
|
||||
Conflicts=postfix.service sendmail.service exim4.service
|
||||
ConditionPathExists={{ stalwart_config_file_path }}
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
LimitNOFILE=65536
|
||||
KillMode=process
|
||||
KillSignal=SIGINT
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
ExecStart={{ stalwart_executable_path }} --config={{ stalwart_config_file_path }}
|
||||
SyslogIdentifier=stalwart
|
||||
User={{ stalwart_system_user }}
|
||||
Group={{ stalwart_system_group }}
|
||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user