Skip to content
Snippets Groups Projects
Commit fe4eab31 authored by shirenn's avatar shirenn 🌊
Browse files

[autoconfig] Deploy config-v1.1.xml

parent bf6d10d5
No related branches found
No related tags found
1 merge request!279[autoconfig] Deploy config-v1.1.xml
---
glob_autoconfig:
provider: crans.org
domains:
- crans.org
- crans.eu
- crans.fr
name:
long: Cr@ns Mail
short: Cr@ns
incoming:
type: imap
hostname: imap.crans.org
port: 993
socket_type: SSL
username: "%EMAILLOCALPART%"
authentication: plain
outgoing:
type: smtp
hostname: smtp.crans.org
port: 465
socket_type: SSL
username: "%EMAILLOCALPART%"
authentication: plain
......@@ -2,3 +2,6 @@
interfaces:
adm: ens18
srv: ens19
loc_autoconfig:
path: /var/www/autoconfig.crans.org
......@@ -3,6 +3,9 @@
[adh_server]
zamok.adm.crans.org
[autoconfig]
hodaur.adm.crans.org
[backup_data]
cameron.adm.crans.org
......
#!/usr/bin/env ansible-playbook
---
- hosts: autoconfig
vars:
autoconfig: "{{ glob_autoconfig | default({}) | combine(loc_autoconfig | default({})) }}"
roles:
- autoconfig
- name: Create base directory
file:
path: "{{ autoconfig.path }}/mail"
state: directory
- name: Deploy autoconfiguration website
template:
src: mail/config-v1.1.xml.j2
dest: "{{ autoconfig.path }}/mail/config-v1.1.xml"
<clientConfig version="1.0">
<emailProvider id="{{ autoconfig.provider }}">
{% for domain in autoconfig.domains %}
<domain>{{ domain }}</domain>
{% endfor %}
<displayName>{{ autoconfig.name.long }}</displayName>
<displayShortName>{{ autoconfig.name.short }}</displayShortName>
{% set i = autoconfig.incoming %}
<incomingServer type="{{ i.type }}">
<hostname>{{ i.hostname }}</hostname>
<port>{{ i.port }}</port>
<socketType>{{ i.socket_type }}</socketType>
<username>{{ i.username }}</username>
<authentication>{{ i.authentication }}</authentication>
</incomingServer>
{% set o = autoconfig.outgoing %}
<outgoingServer type="{{ o.type }}">
<hostname>{{ o.hostname }}</hostname>
<port>{{ o.port }}</port>
<socketType>{{ o.socket_type }}</socketType>
<username>{{ o.username }}</username>
<authentication>{{ o.authentication }}</authentication>
</outgoingServer>
</emailProvider>
</clientConfig>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment