forked from data.coop/ansible
Compare commits
8 commits
Author | SHA1 | Date | |
---|---|---|---|
Jesper Hess | 74e87af1fb | ||
Víðir Valberg Guðmundsson | f4054dcb01 | ||
Víðir Valberg Guðmundsson | 24d91d36af | ||
Víðir Valberg Guðmundsson | cdfa00d453 | ||
Víðir Valberg Guðmundsson | 4f88f200b1 | ||
Víðir Valberg Guðmundsson | d678b15085 | ||
Víðir Valberg Guðmundsson | 92f8d4b0c4 | ||
Víðir Valberg Guðmundsson | 824bc583a1 |
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
BASE_CMD="ansible-playbook playbook.yml -i datacoop_hosts --ask-vault-pass"
|
BASE_CMD="ansible-playbook playbook.yml -i datacoop_hosts --vault-password-file ~/.vault_password_file"
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
echo "Deploying all!"
|
echo "Deploying all!"
|
||||||
|
|
|
@ -1,73 +1,87 @@
|
||||||
$ANSIBLE_VAULT;1.1;AES256
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
34376131343263336262656463373830643861336631626539643663333239313831626236306530
|
62393230613162353938306335363361323162356461613234306332653236326632323038663738
|
||||||
3335623130653432636133356363656465346366303062370a346130326536366638633536613161
|
3832663036633166373961623738323162363532633638350a636565346534616431343862356534
|
||||||
62623334363537636634373231353564396362343330623562383939373538633066616565306235
|
62306562623663623438623263636262303938303562343463333365613834623434623232303531
|
||||||
3332323863353334640a396462313862366362366535383737376333383361303065383937396530
|
6135343464616438360a383163343838323762626435346564313364376566356638623165363537
|
||||||
38326331396333396263363762346331356431623532343938613834663830393337646666336435
|
65616337373633613530393361613561333939666131316366303761303964343762306462633038
|
||||||
66356439333434356165613030306138666163653934386233663362646534303737323030636234
|
36303332336633653432613036346332663863376531623561343433383662623861633862363230
|
||||||
31616132613830363136666639386462363135656432373236393034316664363637663336366435
|
65316536626365303764393839626364326539336637643631336439653761633730636562653066
|
||||||
64373238633064623735666335636231656231666434383066313336303137333663333031363638
|
62353637633365336237663935383937633732363830623232376463326132353062336232363539
|
||||||
31643733336535383338376631656439633962653262356335383638373764353530643234303935
|
64376632616631353138376263383162353866316366316562666538383538633038373535663033
|
||||||
62383930393634613530643739643335616164633038326638356135623561326165376530363461
|
32663363383037666663373335306138623032343939313436656531616234303763396630663639
|
||||||
37373032393331653261373538633065333662393366666161396638383932393331623766343035
|
66656538393538666166386635643563633465306662366436383936306233376361663331353630
|
||||||
30333335663039323931306162313538373334393335306132626336643363323839633761383063
|
64333731396134646236653963356435656535613365353635383734346131383066356431663061
|
||||||
35343632363837383132656437303138303764316439343663303964396463363638336533653930
|
37333533623439623164323738363035633664353831363162376331613965613635653663303339
|
||||||
39303236353766373131623363653835666439333164366563346164626464633633363163323864
|
36623035633865633131363061346366643865636433303733613731643863333764313135616433
|
||||||
65363961393237666433623565343832306663323862666333343665376135646132363466616364
|
30396636653734656631323562343330653839346461653037353439636135316134396533383731
|
||||||
62356331666432336661343762333961333634396466333465633164326239386266643230393566
|
62303164366366616163656462346264383633353164333335613034363636373339613538376166
|
||||||
36376461373631636630303861313538333834646461663539623738636636626537656438646431
|
38333238666334656632376465346538323938653661656130313232656137316463346430663134
|
||||||
38383436393238363038313563633634396335346138626666366437333433383039363332623639
|
36636465356661666138616530326436326238383834336635663963363530316335613233396334
|
||||||
31396165346431333838393164616339656634346561313737306562343562323030613266633263
|
36346634656331623039383266303437323239646563326161653831363833653338386533616231
|
||||||
61333263653938653034356631333664323630306461346532626533363665363133376232316132
|
39613939393334353536613262643030323535396634363330396465303230646133356238373865
|
||||||
61346431383230656134373630653264363430383561313866363235333435633966386266653964
|
62316630303366643965363835336563393838373933393435616532636338376265303830376162
|
||||||
33363534343634343232373036633330613038303437333033313061313932373739343663303931
|
64653931343464656532373831666663326532373631376265636338323430396666383736636438
|
||||||
34333833386638353436653831623835323032303134366635613735643662636336616464313330
|
37346535373761663338653035653738396430316261326333313532653638393535386139376266
|
||||||
36633335613630663233326166633565386238656236633261396235363165656333333235643137
|
32333037303831653364336130646462616537383035633338653435633938303638633364336635
|
||||||
32623461663562313533333835396233383330613661646431646365343430626662326638653330
|
33343963666162356534656635316261353930336431323539393066333930323236396566356330
|
||||||
38646232386263356566373561353130616539346630613363313163363262356264653233313862
|
62333162353965616465396365616630313363636135633835353939633662363664343266373562
|
||||||
34386331363236386534353534616531643264613764343362646366393435383332653664353363
|
36636666343765653530653435316466356139323236356638383230623730643637613633633565
|
||||||
62333935363132373434613038353632643336633136656266316466373734646234636638316265
|
32353234656233353734653233323563313764613333653331333232653730396635633438633362
|
||||||
62646261396465623561633964313065626361316630353965616233356565343834656563353830
|
34306337653732646236346361663937616332353765613131393339393766313131633561376430
|
||||||
38346361336237646331366632633130613330336637326163663463386233643734356165666431
|
62386662393864303865303438616637303363646462313634383431373736643230653665636165
|
||||||
61396263656237333138356231306437653337656133663031303031616437633564613733316264
|
39636638656534363862633134663962383138656637386462356261336465386431343036646233
|
||||||
63633930353033636235653961393330326635626666626235336334653762373262633739356263
|
64666166346334333862653035303461626235633830623639643166373238373136343061303837
|
||||||
32323532333463653937386430663437303238313130643435353739393639303033343865323736
|
39633133653761646231653639653262366334373963343236363233373635306638653865653730
|
||||||
35366139643166626364373663333266376133636433653261316566366630396666336637326664
|
34616230343637616232313639333136313231393133346532353761623038656531376337333339
|
||||||
30343039633133626435363364346666613732666335313865326234366136366130616334396338
|
63316364386162616438303263653936643135316661633266613033366232383232356331336133
|
||||||
61663461623432303930623261336464643830303631396430363637383838616432356634303332
|
35313836363361363637383637643831313238613136396637386136633061666430313963633933
|
||||||
61346536313035376139313638393737393136643366366364363862383335353533313534366534
|
37343663666130326139643663313534313835643162363566396430363831343965613363366161
|
||||||
61356136366465373530393835613834366665653334376539303462336138646438653039306261
|
30353165313932623536393734306461616662663763333031623738383437643862623632656161
|
||||||
36613736323566636634666331396463623439323063356232306631616135623231336439303739
|
31323432633962613366306435626339663638633931323161373331353635306536623836376432
|
||||||
65393837653837336235396532323465656463636238643038383363616633383866333633663831
|
37373033306530623162316430613933366331303766386538396666346464363662646639643634
|
||||||
61363634356634636265663837306232303362313564323463303363323931396438646337363161
|
31373064646630343035326336376464663231343239643137353731303761643037313561313039
|
||||||
61313033343532336563393632373830326631616462616263346363636566663966396330386464
|
32613631353862376230316130333936376565373961383838383932396363396533316530383830
|
||||||
62613039323065343838653439303333396536366537313335353834613338623961646235633764
|
37386139396637613131366161376431323565643434333531656330643331653734393038303336
|
||||||
30333032323333663530613736313765343364363433366436666134623663653336386632333437
|
31366538663231623937653730326264633531623333363932656138396637303932333662383935
|
||||||
64386639636237333138323431333234316432366236613530376234636438356531636630396431
|
39323437396361613038376335353732333839383965313262643165363635386231666634653665
|
||||||
63643833366136363962346632616161363565336163313764383030303337346565613939383563
|
63333034663735623438393063333064363133396537646433383861613337313631633634343063
|
||||||
65306137633965326534356666346238363137323233336561643333386265613863396338383134
|
34303065343965343633653331393131613334356162323466656164343730323032396134303763
|
||||||
35363135303232376364306234323435356330333061613663326563343533636165356537336536
|
63393835646361316530643932613531326235313961663937653264656535623932303038616662
|
||||||
61656131343966346365396133666662393930663237643134383963303766306534633034356335
|
39336136346361636132303434373461333466333833313139346531303837306238613664613731
|
||||||
37633732393266633965616330643061616664336430643630633033326335643438373737653164
|
33363766393862663336383930326638346132326138623537656263366262353637626436313736
|
||||||
34633737303533666335306466306330343233326531343065666138633166383664333130653864
|
32643837303761336230353037663235323265313939323436323736366565663533626365376361
|
||||||
37623730333532633936316461333066313065316664383934343731616430366135346138663531
|
62633730373864386438653137326136373866363164616633636137356133643330623035323838
|
||||||
33353134333934376663336366663036383630393031303731653332373335333131633136616537
|
33326137393937383833346537633361383966313230636133363663373638373864393838636161
|
||||||
33666266373439346633373735643339653333626237623530346436306438396332613863346264
|
64386631366530653063656634336537396330633763336235393538356139323565336134326337
|
||||||
30346431393735326566393633626535383538343866653262653330366330623930646631663961
|
61633330333164643166373064623032356135623336393262386461646535326462393638373866
|
||||||
38656138313932623131613537376139666137653063313339666333313364343738306439656264
|
37626266393962393564306530336462323137386434626363383365366238636235356432323533
|
||||||
32346533646465376135376531383132396337653966393133316436616563613135353863653064
|
65343262666162643932393061363531346464393363623037366639376536386234646135646330
|
||||||
31373466616135393036333037623164346539323463333037613030386666396363353364396439
|
36623837356637353132643435633632356266323830653866393636316130306538336334376234
|
||||||
39616536646638623739623834363662643566393430623632646434336162316362653434343337
|
36303265363037306436346666376337653837373839313732386131306535666639653733353737
|
||||||
36623334303866343533623538663531303366343136636631376334653636313264376330313836
|
66353531623431663532623865373931656233333234356532363730643234633963653435356237
|
||||||
66333131343062373138663330313633623166303337306466313362343034316364666666373965
|
61633134333536616235626666333738613637366264613961333663336330653132313234653132
|
||||||
36373933343338646333373962623034353631623535306230346663373530346438386334303536
|
39383336623736333634633863356366383430306465373932366534626131343236336439343663
|
||||||
62366666646263303764303330353835633163363666303133333730343263613039346162356532
|
38643133626566366163653164356436313661626432653435616630336563386466383939613038
|
||||||
37323133613037313430366238313261633165643563666239623730653164666264633964626461
|
30336433663563343532663032633161363535643962646161396531646130343431663863633736
|
||||||
31323536623335636333393338333166346336323132373466396432613133613933356232373532
|
33656437363432623135313163323064353863303164656661633161616536313165383939663935
|
||||||
30653564323031636231343232646165653163393663663731313033323763663965356466366562
|
65393164363533663934643034316332643137643861333233303062333138633337323330323865
|
||||||
33303830656238653164646161366265636566393436323135356630393033316337363361306363
|
63633538626537363739623132336466393835316565633936616562656466316363623432303231
|
||||||
30393766636237336466353431616130653961326431323161313234333963643032393061303265
|
37383465393034346130616632616539653735323730633035333138373632313662373566373265
|
||||||
33396664336535353164643462303636616265306338333634376664323837303238623638313266
|
63623761323763616634343966386233306435633965633764363133306531363739613039386231
|
||||||
37643861343034646532626164353238373031633861623663316638333039643036353932323962
|
39376432656662653165373162623565393964396538653065343164663233313465363537663963
|
||||||
39616136653639313232326362663834333363633562646563393561396464383765616230333230
|
35326461313761363734306664623265663335333661633732626233323332383335613437633936
|
||||||
39663939326332333362
|
66383031363332353937303165643864666236356133643861373032613366333837356434613437
|
||||||
|
63346637316465306330306135343338623238363139633939653730323961353630353365323938
|
||||||
|
30373165336337303434316336363737623439306633306363383433383666653661613030393466
|
||||||
|
35323762616664393838396365636334626130663839666438633361356164663562303930623664
|
||||||
|
39653235646230363031613061383563663761636131623064633265363737633433623130316234
|
||||||
|
32643836393530373535353732373730303932313131653465353432353065326566633965656531
|
||||||
|
64323462616638646234636662346532663964366538653934646538303237366531613939666338
|
||||||
|
64643666626338333036363234663664326439306432353833633637373439616661666434313831
|
||||||
|
34383334386538656564653862333565623165316439666235376535396232336263663033396532
|
||||||
|
31393866636661303934306536343065366265376131326238616338336161646139393464346534
|
||||||
|
34643664646535316133636236356430316434613762313738623066653336616339383366653934
|
||||||
|
32663930333366623032663838656632643532303136663664303035346237616630653262346461
|
||||||
|
33343066346233313534323831646139636263306132666563333963633664323463333262316664
|
||||||
|
65636635333562636333303964666164393533653033336539663162333764376362373165613734
|
||||||
|
6366393631666464616334646262316161363136646334356133
|
||||||
|
|
|
@ -30,3 +30,8 @@ drone_secrets:
|
||||||
restic_secrets:
|
restic_secrets:
|
||||||
user_secret: xxx
|
user_secret: xxx
|
||||||
encryption_secret: xxx
|
encryption_secret: xxx
|
||||||
|
|
||||||
|
mailman_secrets:
|
||||||
|
postgres_password: xxx
|
||||||
|
hyperkitty_api_key: xxx
|
||||||
|
django_secret_key: xxx
|
||||||
|
|
|
@ -76,13 +76,22 @@ drone:
|
||||||
domain: "drone.{{ base_domain }}"
|
domain: "drone.{{ base_domain }}"
|
||||||
volume_folder: "{{ volume_root_folder }}/drone"
|
volume_folder: "{{ volume_root_folder }}/drone"
|
||||||
|
|
||||||
|
mail_subnet_base: "192.168.203"
|
||||||
|
|
||||||
mailu:
|
mailu:
|
||||||
version: 1.6
|
version: 1.6
|
||||||
domain: "mail.{{ base_domain }}"
|
domain: "mail.{{ base_domain }}"
|
||||||
dns: 192.168.203.254
|
dns: "{{ mail_subnet_base }}.254"
|
||||||
subnet: 192.168.203.0/24
|
subnet: "{{ mail_subnet_base }}.0/24"
|
||||||
volume_folder: "{{ volume_root_folder }}/mailu"
|
volume_folder: "{{ volume_root_folder }}/mailu"
|
||||||
|
|
||||||
|
mailman:
|
||||||
|
domain: "lists.{{ base_domain }}"
|
||||||
|
volume_folder: "{{ volume_root_folder }}/mailman"
|
||||||
|
core_ip: "{{ mail_subnet_base }}.12"
|
||||||
|
web_ip: "{{ mail_subnet_base }}.13"
|
||||||
|
database_ip: "{{ mail_subnet_base }}.14"
|
||||||
|
|
||||||
portainer:
|
portainer:
|
||||||
domain: "portainer.{{ base_domain }}"
|
domain: "portainer.{{ base_domain }}"
|
||||||
volume_folder: "{{ volume_root_folder }}/portainer"
|
volume_folder: "{{ volume_root_folder }}/portainer"
|
||||||
|
|
10
roles/docker/files/mailman/mailman-extra.cfg
Normal file
10
roles/docker/files/mailman/mailman-extra.cfg
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[mta]
|
||||||
|
incoming: mailman.mta.postfix.LMTP
|
||||||
|
outgoing: mailman.mta.deliver.deliver
|
||||||
|
# mailman-core hostname or IP from the Postfix server
|
||||||
|
lmtp_host: localhost
|
||||||
|
lmtp_port: 8024
|
||||||
|
# Postfix server's hostname or IP from mailman-core
|
||||||
|
smtp_host: smtp
|
||||||
|
smtp_port: 25
|
||||||
|
configuration: /etc/postfix-mailman.cfg
|
11
roles/docker/files/mailman/postfix.cf
Normal file
11
roles/docker/files/mailman/postfix.cf
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
append_at_myorigin=no
|
||||||
|
append_dot_mydomain=no
|
||||||
|
recipient_delimiter = +
|
||||||
|
unknown_local_recipient_reject_code = 550
|
||||||
|
owner_request_special = no
|
||||||
|
virtual_mailbox_maps = regexp:/opt/mailman-core-data/postfix_lmtp \$virtual_alias_maps
|
||||||
|
transport_maps = regexp:/opt/mailman-core-data/postfix_lmtp
|
||||||
|
local_recipient_maps = regexp:/opt/mailman-core-data/postfix_lmtp
|
||||||
|
relay_domains = regexp:/opt/mailman-core-data/postfix_domains
|
||||||
|
always_add_missing_headers = yes
|
||||||
|
local_header_rewrite_clients = permit_sasl_authenticated
|
97
roles/docker/tasks/services/mailman.yml
Normal file
97
roles/docker/tasks/services/mailman.yml
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: copy nginx configuration to link static files
|
||||||
|
template:
|
||||||
|
src: "templates/mailman/nginx_vhost"
|
||||||
|
dest: "{{ nginx.volume_folder }}/vhost/lists.data.coop"
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: run mailman server containers
|
||||||
|
docker_compose:
|
||||||
|
project_name: "mailman"
|
||||||
|
definition:
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
mailman-core:
|
||||||
|
image: maxking/mailman-core:0.3.11
|
||||||
|
volumes:
|
||||||
|
- "{{ volume_root_folder }}/mailman/core:/opt/mailman"
|
||||||
|
stop_grace_period: 30s
|
||||||
|
links:
|
||||||
|
- mailman-web:mailmain-web
|
||||||
|
- database:database
|
||||||
|
depends_on:
|
||||||
|
- database
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: "postgres://mailman:{{ mailman_secrets.postgres_password }}@172.19.199.4/mailmandb"
|
||||||
|
DATABASE_TYPE: "postgres"
|
||||||
|
DATABASE_CLASS: "mailman.database.postgresql.PostgreSQLDatabase"
|
||||||
|
HYPERKITTY_API_KEY: "{{ mailman_secrets.hyperkitty_api_key }}"
|
||||||
|
HYPERKITTY_URL: http://172.19.199.3:8000/hyperkitty
|
||||||
|
MTA: "postfix"
|
||||||
|
SMTP_HOST: "{{ smtp_host }}"
|
||||||
|
SMTP_PORT: "{{ smtp_port }}"
|
||||||
|
SMTP_HOST_USER: "noop"
|
||||||
|
MM_HOSTNAME: "172.19.199.2"
|
||||||
|
networks:
|
||||||
|
mailman:
|
||||||
|
ipv4_address: 172.19.199.2
|
||||||
|
postfix:
|
||||||
|
external_services:
|
||||||
|
|
||||||
|
mailman-web:
|
||||||
|
image: maxking/mailman-web:0.3.11
|
||||||
|
depends_on:
|
||||||
|
- database
|
||||||
|
links:
|
||||||
|
- database:database
|
||||||
|
volumes:
|
||||||
|
- "{{ volume_root_folder }}/mailman/web:/opt/mailman-web-data"
|
||||||
|
environment:
|
||||||
|
DATABASE_TYPE: "postgres"
|
||||||
|
DATABASE_URL: "postgres://mailman:{{ mailman_secrets.postgres_password }}@172.19.199.4/mailmandb"
|
||||||
|
HYPERKITTY_API_KEY: "{{ mailman_secrets.hyperkitty_api_key }}"
|
||||||
|
DJANGO_ALLOWED_HOSTS: "lists.data.coop"
|
||||||
|
SERVE_FROM_DOMAIN: "lists.data.coop"
|
||||||
|
MAILMAN_ADMIN_USER: "valberg"
|
||||||
|
MAILMAN_ADMIN_EMAIL: "valberg@orn.li"
|
||||||
|
MAILMAN_REST_URL: "http://172.19.199.2:8001"
|
||||||
|
SECRET_KEY: "{{ mailman_secrets.django_secret_key }}"
|
||||||
|
SMTP_HOST: "{{ smtp_host }}"
|
||||||
|
SMTP_PORT: "{{ smtp_port }}"
|
||||||
|
VIRTUAL_HOST: "lists.data.coop"
|
||||||
|
VIRTUAL_PORT: 8000
|
||||||
|
LETSENCRYPT_HOST: "lists.data.coop"
|
||||||
|
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
|
||||||
|
networks:
|
||||||
|
mailman:
|
||||||
|
ipv4_address: 172.19.199.3
|
||||||
|
postfix:
|
||||||
|
external_services:
|
||||||
|
|
||||||
|
database:
|
||||||
|
image: postgres:13
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: mailmandb
|
||||||
|
POSTGRES_USER: mailman
|
||||||
|
POSTGRES_PASSWORD: "{{ mailman_secrets.postgres_password }}"
|
||||||
|
volumes:
|
||||||
|
- "{{ volume_root_folder }}/mailman/database:/var/lib/postgresql/data"
|
||||||
|
networks:
|
||||||
|
mailman:
|
||||||
|
ipv4_address: 172.19.199.4
|
||||||
|
|
||||||
|
networks:
|
||||||
|
mailman:
|
||||||
|
driver: bridge
|
||||||
|
ipam:
|
||||||
|
driver: default
|
||||||
|
config:
|
||||||
|
- subnet: 172.19.199.0/24
|
||||||
|
postfix:
|
||||||
|
external: true
|
||||||
|
external_services:
|
||||||
|
external: true
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: create mailu volume folders
|
- name: "[Mailu] create mailu volume folders"
|
||||||
file:
|
file:
|
||||||
name: "{{ mailu.volume_folder }}/{{ volume }}"
|
name: "{{ mailu.volume_folder }}/{{ volume }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -17,12 +17,12 @@
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: volume
|
loop_var: volume
|
||||||
|
|
||||||
- name: upload mailu.env file
|
- name: "[Mailu] upload mailu.env file"
|
||||||
template:
|
template:
|
||||||
src: mailu.env.j2
|
src: mailu.env.j2
|
||||||
dest: "{{ mailu.volume_folder}}/mailu.env"
|
dest: "{{ mailu.volume_folder}}/mailu.env"
|
||||||
|
|
||||||
- name: hard link to Let's Encrypt TLS certificate
|
- name: "[Mailu] hard link to Let's Encrypt TLS certificate"
|
||||||
file:
|
file:
|
||||||
src: "{{ nginx.volume_folder }}/certs/{{ mailu.domain }}/fullchain.pem"
|
src: "{{ nginx.volume_folder }}/certs/{{ mailu.domain }}/fullchain.pem"
|
||||||
dest: "{{ mailu.volume_folder }}/certs/cert.pem"
|
dest: "{{ mailu.volume_folder }}/certs/cert.pem"
|
||||||
|
@ -30,20 +30,40 @@
|
||||||
force: yes
|
force: yes
|
||||||
|
|
||||||
|
|
||||||
- name: hard link to Let's Encrypt TLS key
|
- name: "[Mailu] hard link to Let's Encrypt TLS key"
|
||||||
file:
|
file:
|
||||||
src: "{{ nginx.volume_folder }}/certs/{{ mailu.domain }}/key.pem"
|
src: "{{ nginx.volume_folder }}/certs/{{ mailu.domain }}/key.pem"
|
||||||
dest: "{{ mailu.volume_folder }}/certs/key.pem"
|
dest: "{{ mailu.volume_folder }}/certs/key.pem"
|
||||||
state: hard
|
state: hard
|
||||||
force: yes
|
force: yes
|
||||||
|
|
||||||
- name: run mail server containers
|
- name: "[Mailman] copy nginx configuration to link static files"
|
||||||
|
template:
|
||||||
|
src: mailman/nginx_vhost.j2
|
||||||
|
dest: "{{ nginx.volume_folder }}/vhost/{{ mailman.domain }}"
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: "[Mailman] copy postfix override"
|
||||||
|
copy:
|
||||||
|
src: mailman/postfix.cf
|
||||||
|
dest: "{{ mailu.volume_folder }}/overrides/postfix.cf"
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: "[Mailman] copy mailman config"
|
||||||
|
copy:
|
||||||
|
src: mailman/mailman-extra.cfg
|
||||||
|
dest: "{{ mailman.volume_folder }}/core/mailman-extra.cfg"
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: Start containers
|
||||||
docker_compose:
|
docker_compose:
|
||||||
project_name: mail_server
|
project_name: mail_server
|
||||||
pull: yes
|
pull: yes
|
||||||
definition:
|
definition:
|
||||||
version: '3.6'
|
version: '3.6'
|
||||||
services:
|
services:
|
||||||
|
|
||||||
|
### Mailu containers ###
|
||||||
redis:
|
redis:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
restart: always
|
restart: always
|
||||||
|
@ -117,6 +137,7 @@
|
||||||
env_file: "{{ mailu.volume_folder}}/mailu.env"
|
env_file: "{{ mailu.volume_folder}}/mailu.env"
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ mailu.volume_folder }}/overrides:/overrides"
|
- "{{ mailu.volume_folder }}/overrides:/overrides"
|
||||||
|
- "{{ mailman.volume_folder }}/core/var/data:/opt/mailman-core-data/"
|
||||||
depends_on:
|
depends_on:
|
||||||
- front
|
- front
|
||||||
- resolver
|
- resolver
|
||||||
|
@ -149,6 +170,73 @@
|
||||||
dns:
|
dns:
|
||||||
- "{{ mailu.dns }}"
|
- "{{ mailu.dns }}"
|
||||||
|
|
||||||
|
### Mailman containers ###
|
||||||
|
mailman-core:
|
||||||
|
image: maxking/mailman-core:0.3.11
|
||||||
|
volumes:
|
||||||
|
- "{{ mailman.volume_folder }}/core:/opt/mailman"
|
||||||
|
stop_grace_period: 30s
|
||||||
|
links:
|
||||||
|
- mailman-web:mailmain-web
|
||||||
|
- database:database
|
||||||
|
depends_on:
|
||||||
|
- database
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: "postgres://mailman:{{ mailman_secrets.postgres_password }}@{{ mailman.database_ip }}/mailmandb"
|
||||||
|
DATABASE_TYPE: "postgres"
|
||||||
|
DATABASE_CLASS: "mailman.database.postgresql.PostgreSQLDatabase"
|
||||||
|
HYPERKITTY_API_KEY: "{{ mailman_secrets.hyperkitty_api_key }}"
|
||||||
|
HYPERKITTY_URL: "http://{{ mailman.web_ip }}:8000/hyperkitty"
|
||||||
|
MTA: "postfix"
|
||||||
|
SMTP_HOST: smtp
|
||||||
|
MM_HOSTNAME: "{{ mailman.core_ip }}"
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
ipv4_address: "{{ mailman.core_ip }}"
|
||||||
|
external_services:
|
||||||
|
|
||||||
|
mailman-web:
|
||||||
|
image: maxking/mailman-web:0.3.11
|
||||||
|
depends_on:
|
||||||
|
- database
|
||||||
|
links:
|
||||||
|
- database:database
|
||||||
|
volumes:
|
||||||
|
- "{{ mailman.volume_folder }}/web:/opt/mailman-web-data"
|
||||||
|
environment:
|
||||||
|
DATABASE_TYPE: "postgres"
|
||||||
|
DATABASE_URL: "postgres://mailman:{{ mailman_secrets.postgres_password }}@{{ mailman.database_ip }}/mailmandb"
|
||||||
|
HYPERKITTY_API_KEY: "{{ mailman_secrets.hyperkitty_api_key }}"
|
||||||
|
DJANGO_ALLOWED_HOSTS: "{{ mailman.domain }}"
|
||||||
|
SERVE_FROM_DOMAIN: "{{ mailman.domain }}"
|
||||||
|
MAILMAN_ADMIN_USER: "valberg"
|
||||||
|
MAILMAN_ADMIN_EMAIL: "valberg@orn.li"
|
||||||
|
MAILMAN_REST_URL: "http://{{ mailman.core_ip }}:8001"
|
||||||
|
MAILMAN_HOST_IP: "{{ mailman.core_ip }}"
|
||||||
|
SECRET_KEY: "{{ mailman_secrets.django_secret_key }}"
|
||||||
|
SMTP_HOST: smtp
|
||||||
|
VIRTUAL_HOST: "{{ mailman.domain }}"
|
||||||
|
VIRTUAL_PORT: 8000
|
||||||
|
LETSENCRYPT_HOST: "{{ mailman.domain }}"
|
||||||
|
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
ipv4_address: "{{ mailman.web_ip }}"
|
||||||
|
external_services:
|
||||||
|
|
||||||
|
mailman-database:
|
||||||
|
image: postgres:13
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: mailmandb
|
||||||
|
POSTGRES_USER: mailman
|
||||||
|
POSTGRES_PASSWORD: "{{ mailman_secrets.postgres_password }}"
|
||||||
|
volumes:
|
||||||
|
- "{{ mailman.volume_folder }}/database:/var/lib/postgresql/data"
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
ipv4_address: "{{ mailman.database_ip }}"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
- "{{ nginx.volume_folder }}/html:/usr/share/nginx/html"
|
- "{{ nginx.volume_folder }}/html:/usr/share/nginx/html"
|
||||||
- "{{ nginx.volume_folder }}/dhparam:/etc/nginx/dhparam"
|
- "{{ nginx.volume_folder }}/dhparam:/etc/nginx/dhparam"
|
||||||
- "{{ nginx.volume_folder }}/certs:/etc/nginx/certs:ro"
|
- "{{ nginx.volume_folder }}/certs:/etc/nginx/certs:ro"
|
||||||
|
- "{{ volume_root_folder }}:/docker-volumes/:ro"
|
||||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||||
|
|
||||||
- name: nginx letsencrypt container
|
- name: nginx letsencrypt container
|
||||||
|
|
|
@ -8,6 +8,17 @@
|
||||||
gateway: 172.16.0.1
|
gateway: 172.16.0.1
|
||||||
|
|
||||||
- name: setup postfix docker container for outgoing mail
|
- name: setup postfix docker container for outgoing mail
|
||||||
|
vars:
|
||||||
|
mynetworks:
|
||||||
|
- 127.0.0.0/8
|
||||||
|
- 10.0.0.0/8
|
||||||
|
- 172.16.0.0/12
|
||||||
|
- 192.168.0.0/16
|
||||||
|
- 172.19.199.2
|
||||||
|
- 172.19.199.3
|
||||||
|
allowed_sender_domains:
|
||||||
|
- "{{ base_domain }}"
|
||||||
|
- "lists.data.coop"
|
||||||
docker_container:
|
docker_container:
|
||||||
name: postfix
|
name: postfix
|
||||||
image: boky/postfix
|
image: boky/postfix
|
||||||
|
@ -15,5 +26,5 @@
|
||||||
networks:
|
networks:
|
||||||
- name: postfix
|
- name: postfix
|
||||||
env:
|
env:
|
||||||
ALLOWED_SENDER_DOMAINS: "{{ base_domain }}"
|
ALLOWED_SENDER_DOMAINS: "{{ allowed_sender_domains|join(' ') }}"
|
||||||
|
MYNETWORKS: "{{ mynetworks|join(',') }}"
|
||||||
|
|
3
roles/docker/templates/mailman/nginx_vhost.j2
Normal file
3
roles/docker/templates/mailman/nginx_vhost.j2
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
location /static/ {
|
||||||
|
alias {{ volume_root_folder }}/mailman/web/static/;
|
||||||
|
}
|
Loading…
Reference in a new issue