diff --git a/group_vars/all/vault_matrix.yml b/group_vars/all/vault_matrix.yml
index c72b25b7573cced0cdf668359deb87a4234542f8..0c00924ee8469b50bf345dbeab479f5a2a0a1b4c 100644
--- a/group_vars/all/vault_matrix.yml
+++ b/group_vars/all/vault_matrix.yml
@@ -1,166 +1,166 @@
 $ANSIBLE_VAULT;1.1;AES256
-38366530366534653639383464376533666461343134663939356333313731366664653663653232
-3666666466323065383536383334303964353663653937650a623935633361333835333033386561
-36643366323465666435306338393161383338336630656166303132633934653435373533303761
-6134353162666131320a636262653131656239376163613134313261616234613462633439623237
-33653732333366643462643863646233356132373339336631383661643764303332373133373233
-61326162323733656261653366663636353733663236663265373634633638653735613663336565
-37383466653331303638626162666461306331316363383531333539616335383566613066303137
-35333637303238336433653565656639343861326265383361376134326436386436393535646336
-30646665376336343337646265326637393937363437656365343630656665613363613562303132
-37353331623265666661313731653239636235336566653732626337666131626463613536306434
-30393966393831393766393231623239653462386563633165353138343331653262653234393934
-35373661373434326262313631623466316262623764633434323733333262643531333066636533
-61316237363062373134356263373830363037333661393466396539616230666332333439633433
-33313136383036393739666630366365613832313637303734623036323236383161666636386532
-62663639343361653238313964343136383239336539363436656533303034343335326264613634
-62656537396561363231333836626537313562363836393236363565323963333361313932353036
-64663762326438353838373236633238343636626462623665353937373331633534303433613463
-34653363666534613230383531383739353131636639323962396135316538333461646335366235
-35373830363435313634353639316631386336383465373539633964623464363334313362633638
-34393166346661656462633934626136306265633435363261313761613465636366303730316663
-63313830643861633638616262376435316461306266646539363637313463643539366166363239
-38383162663234356166613231383632666634323665656133626138333739383132656632326565
-30333637613237363438613037646639643836653934303930306664343466373761376138353530
-36663634363962663961363532316635343863393036383964363638316539636431636365366564
-64646639383734623036393766653065613338633465363661363232373339306131656238353138
-66633635306430616466336463373762306566323738373436653132656564353166336164646564
-34356437633862653231656330323862386336383138383431313631363335636164343030646335
-65303539313635633330636135623135383930393761643233623962363838366239633131666661
-31386238336662353464386261666164373364663639643264393836613934363431323739336661
-33623638396231623931383535643138633439666335346436363533376336663434313762653338
-62303362333734376239646361333330313131643162633139353861656162373939626262313034
-30306437653938306465373233393264373935623934366437393234616365386234363464383161
-39343339333133363464663661656136653063636139376466313865326533303335643965383932
-36306263326333373837323836623532353866633066333033616536663937383032323266636139
-31666535623564353330336530383637353932313237633034626238633562363961633261303566
-33663833356337643264323132643963643630623635333238653361666139663931646331653566
-65323039386331366635626265323362373832646639666662326666336264323134663339613937
-38633334313734323533323263303438333533393735663130316362656535373931663166333530
-65373837323733323430326432376461643036623163373664643366393032396436326664666663
-36346631636261656134326230363930313532303738623133663966353837636163653532616631
-31323833643466653063353832306236633035306234383237333336643161343332636666393035
-34343430326162653036636638646332633234376666666135366332663561303063303830356439
-37613037336233373461376363636362393064376162653162313531323338313262386134376533
-34613332646537666133626236333835376466336564326637643335613065633661333565383833
-35303332653233333434373432373234636139303865313666616330323537303835393931336362
-66386434303733666162323431643739323831346663383432636435636165303732363465383638
-31626565386638336437356334323164393231633735316536383664613736383938656432616438
-64633630643532316134376337633434313163323536663038613635366239646636616331643935
-36306530393235623830336638376537643764666632346138373766383561623839333966343962
-65653964626465633365313333633132656362643139353565623166623863666531636665373938
-33353363353666343164353433316337613633333230326335366236373962393063663633393766
-61616464306534363964326364383130383734353732623334666238663332643830373636393764
-64643936666665613734346637653335373831313264386362363861353734393534323038346661
-33383365396138656335353137623665626333323830336264376238643534316533636631656636
-36306265346439656665373132323062646335626634623662363730623361653864383464363930
-30643130376666376532613837303438333466626533613532303630346662326261343330636139
-63623339626663623332353033303732333139343766613032633363633331396664356636363631
-30373566383262303234386136346632343930663365666432613262396561376333643963636336
-30376230643631316231346437653834653339343934336335353538356334643534363262313538
-32626531653664323431623038356430336432343339383736366464623639613438383330343738
-38643236303033623635373262303438336637353565323266636630643836613538323661633632
-64626235386435633065633539396363343437323762653234363665373238336565363437616130
-38343763663336303239396238323432333433353038323439666334393962353838633566303565
-38656438643266626434343237316436303436343038613364306233306565653036373666303130
-32353130326131363263303034653336363636616233386237363034323936656638383963326636
-61366137626161323135326334653330623962313566616231633131626431316265353266646363
-66363363613964646466366631623061393364373438333538316636306162623765366237653036
-64343932626133383062616238376337393833383666343530396538303563326663323463376232
-62323332333335346238373633363639306633336365623833626630343162353237366130313130
-64656261646437363233393761373730653332363661303730303761323366306139383466366262
-61303430383061303330306638316632373933623164646264393437623964643566306138363531
-39656566323339383339653936623933396538383931313236343964306464363437353262343931
-61346132376637356665336437373638303266633531366665643836376337383237306636366661
-30313166333335316231653561666630336434623361646466316266623765663163396362633337
-63353838306266333165643839323234613632383438326231353865666336323937353530663237
-66396433363138396165346637346236656438613732343235663763656465316236383937376365
-32633337623337633032346630393661323530626631313636376435316631336639343833323633
-62333235343866313165616365383930636563623961376638383362626331623638326638363465
-63313962653734343962366131303737326530373835366336623138663865636636326261323732
-65633361326139323635356637666230313137663136663532393139333162656664383938636364
-37313734646233313235366563303664366266356164306463656333643330383932316332663734
-66633764303462643664623131653032316630366337353466353436336234306439303933316365
-66303436303939323864623261666334623066383266366637626664623264656664346161666531
-32383564663565343631323337626630356631633439363564383932633961633137303230383630
-31386432333634616661373534363737303231616564623638643032376333333462386665623331
-34396465376635633165623538353638386537363939323062316332373262343261313435636532
-34316238393133353232343863313232323431623235386430346261633530643363373763336361
-66613663323239353839373533653536303234303763613066646130653238383136663839343337
-32653530656330373863336163343764653936656437653039613264353135616433356533316464
-63386361363539336434643739393932373462653732346466386332326339633035616164333433
-34356430363866316466646639636361636533666230653733336161316365333436316262633136
-37353635353637346338336366643231303463623765333865336333323439323437366465393032
-31333962326662633733306639653365646263313631336132346161373633646235653431656564
-35393335373432616665663066313639623038643364653734653333666632303731643737616465
-65323736306365343363396433613838346161646561613466396462383731613734393435656364
-64666430656130373236373034363664386434386661323431336364316662663336326337633132
-35323064366264653965323863613438656435346666383933623238666234613566663866303134
-33663761373036313961393830613464613237666234646239313265316461373065656333616366
-33373532393766336234366236303938386636333564316462343266663039376633343063326338
-34356263343666643837383762336463366231316534626165336339633534393139633735353830
-35636534663339313832353839313834303732353431363364623165376631616137626537333431
-33653734303263666138633462303466353235313136303234373963626164396165346537383663
-61366138323631663466346530333430353937633833343934656263383662353165366536643932
-32623465366665663036383038646362313663323030613264623232663931346237626437653531
-38343765653132373030653538396661383831376435653633343164623866373264393764373364
-62353438636231356430303630313435613131316335353961373165396232356163653863643430
-38396131383234653034373534346238613761656230646532303565373338376263323938336465
-63326431666430303538333063343030373132363933636434306263393739636636633333643830
-37343534323761333463353065613565653165393565353332666236306232656237326566393938
-31346633623333313333316336303133653139633966643266383935346265376563663735643464
-34616366336535356161303165396633646437386337323038623539616463333830663638623464
-36363535386562623764326436643937393333396462636534373366326434333535643431303065
-36653136306637343233626462323163326635623837666666353764383732613261633432373339
-65623537613265393566353539353765393238373634373163373330363765653437336362623163
-63646132623931336365663231663333626266306332323431313532333765353936653536313638
-36616663623362633765323935636333353466633263383032343235353862346663326332643064
-39316131366461643132643164623064363930616133393364656138356636613166663931643461
-30306431346165653765313362656633653837363537383832626561336136663133313937666465
-36393530623263393761363163346239613266393834653639333131616334373033386539363937
-38356530333636656435353138373261666465633936353739646632336536626633373965363439
-31386461376239373962666564306561306534616666373834373234656239363266663933373531
-66303636303164656538653036353264326266363464363131653538626234623238336362626632
-33356432346538396464656337393337303563633733303136333731326335633565333635323430
-66393964623934303262656462366133626230316533363938343934626538386565353765363236
-31356665623833383637323964393735373930643361353432646334366435363532366439646662
-34316365326131363333313734613237666439626430353765303836353735393836353464336132
-30393561343835313336363961343139343434323963653238616634613161613234623537383134
-30326261653335393536623638363564613635313361653534356531396130336661653236313135
-30643564323730623066366161326232626539353333353234353237306665343130626334623764
-39383239613031356565383431613937396339366163343962306432386334653436376532393536
-37376266313262386465636134393030663036323230636435323735383465383065373739303533
-39393961666231316535316132636331343831363930376561303133346337313530323438633135
-35643563313761323662386630373061326435626666343133396463373231313462623039643061
-32316436323031326539373230663366353638396430613861326465303133376561666135393637
-37616132306635633839393334336639613833383330613462383538386139363463376537316434
-31396432326263326365643638393661343331373438356432626365373738376632623164326235
-37373837626430346366623261336565303833613130346230666361653462656165383362366663
-32306365333135666538313361303039383238366633376465653366346363373663363831356138
-34366336356236363139626332316161303830373937326638326334613764386438313730663738
-63323039306238616463643331303136333231356539663266656635666636363163643563336161
-39326266316435323038636366373932366530623463383737666133633936646263393134363166
-65306635383437363538613636643833633564623366383632336538663663613933313835336234
-34336433343430393137626334646537656161353434376337323737623739313263633966656238
-62316461343732306138633334633338633265633931386166316265363930373437633630343930
-31363336346338373938383634613236373836646361363461373165316663376234306666396630
-33643431646461303639323337393132666139323932653231623663333334353466333136613666
-61646138616131613035653265363433663132376661386635366137646633643135346365656637
-61656461376239396539396461383365666463326235353661636537643639336138383033633238
-66626564353566643339333432376435663962663538353665366134653834646664373838646630
-66316461316430386666616535393833626163656639303039663136313238383636646639383636
-34306264313338613338366561353934623735343833333833373566633635613662626639353430
-36393933363439363231633565616635306464306137393332353832366130336339346335393538
-62376461393263356636396633333435393531393164633765376438613039636466303739353137
-66363032626662636138393533313931616131343431396139346134333937313062333839376134
-32636561376534643535323863663161616530383261633937343565623263636166653136346231
-66326138303566666163376233666166303234386333643861353730343864663536313433373032
-66353363383939396362666233623538623065653834623561623336656139653730373932313566
-62366335336163326562303338333436313461313731373031633235636431636634656166373337
-63616330643766366235663232333933613731613539323830643034343132633733646634666431
-33363061386563643135366164613133373030306463363361376136326661363566613936323635
-63613138626138333362306631623835353234613566313537353765353030656131636433613433
-66363462623464613862326262363862373630663732613764313735616539336235303635316236
-34353839336335386630653932333237353263613165373066393630323263356430653266393162
-33663261626435653761626132613264363930356539663963313438323033666361653736356335
-35303034376432363030323931636333643935343735373962306233343630303764
+34353433373234313033636537633638336230643363623565636330393366376539613463643137
+6361313035356439393361356636643661646438343365300a343831363563353562623765393335
+39636331343563323266346534396565363938316630356362383264353432396661376633373437
+3933633565656435320a623462316162316665333863316161333865396662386338396531666563
+32643433336662376165623937326132626438373530306565316466666265383136393837323362
+38653364313637306437333632613633653462326138636561646165306435346166333639373065
+35636430346232363835396538383863633161373861316234343163633734323038623139373335
+32666338333434653731653937333664653332316233363335396536333233396430386161656463
+38653666643739333839383230656364373538376537393739313534373732316238343063373363
+31303339353739326639653933373166356363393566343066313636636335616135346561316134
+64366635333034363833356161396663363033386330333030396464376439366261353930306664
+37343633383937306439323663643534626438623536626131303564303065613465383131313033
+37363235383866623766393264336239303163316337626535386238306334393839663939616239
+34646638383439303761373634333161323734356239323566383037333961386265643139343030
+37626438653635333363343435613463333537633235656433386236323966306462646238326366
+35383865313336393437396536393438396266633461306266653733616565633731373437616435
+63356638653231343365616637313536396433333264623133393231623332323061663562353435
+35373134353030306265373837363662326365373563326430373938353534623762383462363735
+63343434386633633562333638653137353030323438336539613931663261653165616337336637
+34316466366639333839346437353232646334373962326633613635333536626232303131396537
+64643633313461306534316134653563376132383333376636363135376338653064663762623530
+31633937623163396535643037363536313763333332353763323339383639343639623064643066
+35373765373533643831373835303263663833666562613030306435336231613166356661316464
+39386131643931323135633137383835396564636663373661363538643166343664336663663033
+31316465663661623333653636363839653861323563323865613436336337303933363363323437
+33633661346431353165336334623739633736333265343030393338363161343137313464363938
+33653339663335633434383261336531636332613138313663373764633235303963643038353663
+36343539626434646436383661633462653939623839366563633334346562616366383866396462
+64303631333235366362383065333132306437313039373833386533623562343137623361646234
+33653434386438336137313164663235313337346266633438376637633663323261373335386633
+61363764356161666337643564353130323035373530616533346333363466383061336635633738
+65313634656533626162376131336466313966616436666530616265356336343031353961313535
+37373234353437323061663138306261343639623762623863353836396630303961306562313536
+38623161376330313736346230666133643435333530393461303664353636333936383164633830
+37383438333634366431376263616664383633663065323531383365643133363037316535386138
+33663139633131643262353733353561313733326336313837653239383364393036623661666266
+61663462393965393331343831333933613338313366323230633161353965393664663766363632
+36646135363863393865653233653061356233306432643165343535663735613231663534346264
+61343065653134336337336364363535623762663434363138653236333835333163623031636635
+38343234383231343532626136643731303036616134363338643463663564653936396132623032
+61383066363861336566373362663366646166653737396566626566353765643130626639646335
+61393266366331616539643036383931323465323931663430383362373564323465393038346136
+31376563336262623838343737333835373030346261333263653965316239373164613265393161
+32653961326363626165376266383830636337666164633461336230313563363537356636633732
+35336361353739343061623264353932363130373635646366616262303266313735313134653235
+34303732613235646139666261353135616438393939393433616534366235393038616339323930
+39643939356137663331376361666466373936393064613130383235666530386265663539623265
+39333564373034653264333133663638313561303230646537646635633636306463333334613432
+39656230373336663933613763336538386434343162373538336131386132336633646230346239
+64376636313633646464643634353966666434666465313164323938316339613734646135633237
+61366537396237613632343034643763313763393631363166643932653262303830663464323938
+31396630626639383766623563396530316431366430353839643161393335316265383232336237
+39346438613363346334356564373936366134393230323834336536366536323235353931666439
+31613735633436386530393730333864333035303263663036653531356566616438626535373130
+64383164376461353935303031333463383635356232383038393133663662396131666230396137
+30636663613133366230373933366536376538396665663064313962356463376666373365663364
+34326337323831346563393233626362373536353737616534313736653838383463383361363438
+32356433366433333931383661613263303435323665623364653532333534386339616166626462
+32386534643237393437333037373231376530613962316238343531313631633332666636313439
+64356232366631663961643765363862313735346234343631616561323730343434313066633666
+37323332356430393531623438643533613837383437336635623837316566633636613137366239
+35366232393662633163313262333134643432333939643132363733653332616261643832353533
+38333833393362333230343166393365383435363665616163346230356338643263366630663639
+37633863383539653163386631653463323337323466626636316665333133653336316335336264
+30613237373539356165656264313333623162343039396631623637653365306633303331643337
+37646165656363633232613032646264336534316437323735633539393834656563363438323034
+66373564373533373766613165306462366337326239613436663430333266616562363134333235
+65303161653731306231393764656437366535393036303136356137316435336330366436633331
+63306230663266303438653437633864656137666362393035653836616361323933623333333938
+65323136326238653763626562616132363164313561666337323838343033303366613138316666
+61633739373937326638646666646463623736626331353761343033626331373334666335336261
+39393962633138356561643265656632383737373361313866373562643434633838616464343761
+36636665396536636161303636313735353139353438316233353039613434626435376264346564
+65623563383630646266633133353736353066636261353763623535623730386561663532336461
+30643863386130343661343061613939633532363466363239383738366466303834343766383163
+65636165343237626532353762656565643565343331646333393266356461316633353866336339
+61646461346162306334623036373231303964646133313165383036656536383235393737653236
+30616438646238626466383362336132373634646337623636373736323233356134643966633363
+36333462633430613731343766323430356663396133353239333661396137623837356266346530
+64643333343433646635386631353037623531643234633563336138353532313439356661653132
+36386636616238303661666232383930393336666366366262376564313538643130666238613530
+30616131623266613239666137613137356534313834633165663236656132666364343366356235
+38366139656138333866633961633362633438373437353936656637613731663634383034623434
+65343636373539313766656635336565323331313265373037366266343038353437313931393263
+63366339396164386363343139396638303534313965643662396336396638646236346638663039
+63636330393961336564643338623165653737613234333836373833623731393932633035633634
+35396634616331376361353130616166316632343262356664373864623164663233323463343639
+33333466363130356235393362663333373837356164333664376432333432656166643034373031
+39346336393061653563373162656565316638373839336461656434646261356365633961666262
+39393433333537303439373463623931336236623132653263396332623339636538643838626635
+62303734643239646433336238336134323331393364336331386330323466376563643434646639
+36643733343562383634303765303036613830323162383835393962316539333830663166666564
+32306334616430393362326337313466323736333630353334656534613339326239363163333736
+63326239653766376531316331323864333530333961653435383038326164653238636439626133
+30303031626130623061356264393966383465633665363830323530636463633830383566633862
+30623866626430633666313834346632636662346664326463326665326432633234633730303537
+61623765653334643531383466333865643531343330373933363338356364313830313462653365
+38386330383061333034356634313364653830663830316233643730643334393935383037333665
+32326333363434643036333638303639643666373530343930306630613330653061353162623161
+34313139323633313466333461383630623436346233623063666436313861643465653732386132
+65323266303734666435303635613562386131373261623261303930383663383930306339636330
+63383730346261663138616262303266366430646632363535666333386462653763666563336163
+39616563383732653939653736633132396561633335333166353761383365343534333464316266
+63656537343237363265313738326364396338383561306439353032373933346536336265633561
+65303234656233346464623538353837653766366437343964366435656330333936316562626664
+34333234646661323163353530303335333265623836366330323132323336663636623736653863
+64303333613835356530646363643331323934353234666339396162316338646136626539656234
+66313964356332643133343062373730303730313930383639666332363439343838636335643165
+34356238653032303565343130366663656130616632383030333335346336376135373534346431
+38323935396665323935663138386139646262336535613133623538343134636236643562393337
+64313663653138616531653964666464333738643335633733383065343230303333633633653766
+63333232616433363566306531653430353037633230633330393430623236303932666433343730
+33623531396139336533376630313033633139623232373439373830393435386339393130333138
+64323234393861316366343736373966653334333233303262376334356331303861393133323866
+30653533393438386133643338346561646233316266656231623232656663333838643036653962
+39373063323735363630353834383764373635633132666136306661653630303930356236383133
+39643336376365386166363931326433333530653139646163343664343535383033653331383431
+39633437623335313837623630376163313538363965333031326235303036316333313336663733
+39663962623231393439313163366662333963336366623038636139336330643832303862323065
+64616464346136663431666464343036316563383832646363353335373764393534623331343965
+31653930616263316135366264393566376239643238363661383861393831336333353561646132
+39356238623836393562356164306336373065373131396662303936343566313066393733656235
+35306263303361333038663065386235336534373735623161663131613638383132323434653236
+38353834613634663362623636336265333639636635616638663934333133373230306362323961
+38326536653034386437306132396463643137353833396563373364363165613664336238396335
+31323233633035663836623661653665323239643566636532323136333433336134346236306232
+31323036326430346365613933393735386562626235643232336130316438336666313433623461
+36393233656264323666663032303266306363623765303430366165366535653339656262363864
+36343762313131376465653765623633353133663232303139613131623735383233313436613864
+30646566633532386266313262396630336166373562313164333964633432383138636162663465
+64653062366435333465656561623433643238336530323834373135313864616164346137376431
+32386432663066356636323665383030366132366438613033636366333764356561643964313532
+34623938616461386631336237323435613337616265663831333264656235326631333762633262
+39643830633233393434303139386465616633636332303233666261303438316535623530343963
+63386339393263623538393161383262663662333166653764633638636635653266376566643138
+36313234316666336562623931333062303761636163323965353363633236373762326131386330
+36303638613861306232373334313339346337386237383035363434643663346566303966633366
+64303238633965393665333764303634346535363336333664633738646661636235663462393862
+31346630326233653465333962386539336435393332306434666338316664373832633831626265
+37626238333339366634313033633737343066383033343032373432383532626166636630366236
+36336465306438636337393361636631323333313461353035366336303031366262336432653033
+66323362646231393631653635336562343338383533303230383634393637396261353432653262
+64393665663263393138353233353930366165313236623736363838343234313632343238303730
+33333966613163376432626661343964303662376565376464633135373962636432666533376661
+39393436393739346362666238346430313632393164356332366236623739316366316135613436
+32366363386462643462383031653231613861383630653933396331313735633764666538386235
+62613064616334623637626234333032356161633731636161323231653865626333626636663335
+31396633633531366432653463323064316162383666666263306462336333653735373535656635
+62643031363331346136623036663064613964326138316634633536636434323265396632616539
+37333932646236333537623737336566613230353964383430336465653463323761613131393963
+63333039656639383837386639613563643466313764633764353733373932346465643566623565
+37393230303563326238353236376639306436646136653030373536303761613132313831663233
+61313563326337306666353931363931663161383163373732656334643363346338616336313561
+36636465353339343731306561363530356166643566626664346531666466643434343638336563
+30346138343532653263383763623233396134663037313936393138306437623464616437646661
+64343864653731303133373139373062326433353861326266366562326630306131306638326237
+38626365633330613837656238613536616438376337333362316431303533373435623936616166
+31303031656230323838313032353235646332323337333239386634666661623333643364616339
+34376132336366623364666333353561306466313438613233353131323837633439346161386162
+64363738633466373035623163643263626166353964616563623665373335346364376339323731
+31303364643336353561626661346431666435326461393664326135633964616232323631346432
+39386266323636353838323236323661613630616633376462303737366264346466303163353465
+65383065663234656233363232613236336136623161303365373834633336643038393236353364
+33666635316137353865353663666463636533393661616532333032336533323261323436306132
+36303239366262306265643834363761336532366335666466306237313533313231
diff --git a/roles/matrix/tasks/main.yml b/roles/matrix/tasks/main.yml
index 1c77a27ad07800e58644233f13fa8259d046da70..5fc13b9748bbe89115407ee8c0485e9025cfa552 100644
--- a/roles/matrix/tasks/main.yml
+++ b/roles/matrix/tasks/main.yml
@@ -55,7 +55,6 @@
 - name: install matrix-appservice-irc
   npm:
     path: /var/lib/synapse/matrix-appservice-irc
-    production: yes
   become: yes
   become_user: synapse
   become_method: sudo
diff --git a/roles/matrix/templates/appservice-registration-irc.yaml.j2 b/roles/matrix/templates/appservice-registration-irc.yaml.j2
index dedcbadea8e93df1a56998e4d43105deb873a4ca..66db3841595bf4b853086196ebe9a35477ae5d6e 100644
--- a/roles/matrix/templates/appservice-registration-irc.yaml.j2
+++ b/roles/matrix/templates/appservice-registration-irc.yaml.j2
@@ -16,7 +16,7 @@ namespaces:
 {% endfor %}
 
   rooms:
-{% for room in vault_matrix_secrets[matrix_server_name] | json_query("irc_networks.*[].mappings.*[][]") %}
+{% for room in vault_matrix_secrets[matrix_server_name] | json_query("irc_networks.*[].mappings.*[].room") %}
     - exclusive: false
       regex: '{{ room | regex_escape() }}'
 {% endfor %}
diff --git a/roles/matrix/templates/homeserver.yaml.j2 b/roles/matrix/templates/homeserver.yaml.j2
index c9fabe4205e93465ab426443204e3d6d63003c54..eb5953bac172caa5964931b37668b5a9e1797e0e 100644
--- a/roles/matrix/templates/homeserver.yaml.j2
+++ b/roles/matrix/templates/homeserver.yaml.j2
@@ -377,17 +377,17 @@ retention:
   #
   # The rationale for this per-job configuration is that some rooms might have a
   # retention policy with a low 'max_lifetime', where history needs to be purged
-  # of outdated messages on a very frequent basis (e.g. every 5min), but not want
-  # that purge to be performed by a job that's iterating over every room it knows,
-  # which would be quite heavy on the server.
+  # of outdated messages on a more frequent basis than for the rest of the rooms
+  # (e.g. every 12h), but not want that purge to be performed by a job that's
+  # iterating over every room it knows, which could be heavy on the server.
   #
   purge_jobs:
     - shortest_max_lifetime: 1d
       longest_max_lifetime: 3d
-      interval: 5m
+      interval: 12h
     - shortest_max_lifetime: 3d
       longest_max_lifetime: 1y
-      interval: 24h
+      interval: 1d
 
 
 ## TLS ##
@@ -867,23 +867,6 @@ url_preview_ip_range_blacklist:
 # Optional account validity configuration. This allows for accounts to be denied
 # any request after a given period.
 #
-# ``enabled`` defines whether the account validity feature is enabled. Defaults
-# to False.
-#
-# ``period`` allows setting the period after which an account is valid
-# after its registration. When renewing the account, its validity period
-# will be extended by this amount of time. This parameter is required when using
-# the account validity feature.
-#
-# ``renew_at`` is the amount of time before an account's expiry date at which
-# Synapse will send an email to the account's email address with a renewal link.
-# This needs the ``email`` and ``public_baseurl`` configuration sections to be
-# filled.
-#
-# ``renew_email_subject`` is the subject of the email sent out with the renewal
-# link. ``%(app)s`` can be used as a placeholder for the ``app_name`` parameter
-# from the ``email`` section.
-#
 # Once this feature is enabled, Synapse will look for registered users without an
 # expiration date at startup and will add one to every account it found using the
 # current settings at that time.
@@ -894,21 +877,55 @@ url_preview_ip_range_blacklist:
 # date will be randomly selected within a range [now + period - d ; now + period],
 # where d is equal to 10% of the validity period.
 #
-#account_validity:
-#  enabled: true
-#  period: 6w
-#  renew_at: 1w
-#  renew_email_subject: "Renew your %(app)s account"
-#  # Directory in which Synapse will try to find the HTML files to serve to the
-#  # user when trying to renew an account. Optional, defaults to
-#  # synapse/res/templates.
-#  template_dir: "res/templates"
-#  # HTML to be displayed to the user after they successfully renewed their
-#  # account. Optional.
-#  account_renewed_html_path: "account_renewed.html"
-#  # HTML to be displayed when the user tries to renew an account with an invalid
-#  # renewal token. Optional.
-#  invalid_token_html_path: "invalid_token.html"
+account_validity:
+  # The account validity feature is disabled by default. Uncomment the
+  # following line to enable it.
+  #
+  #enabled: true
+
+  # The period after which an account is valid after its registration. When
+  # renewing the account, its validity period will be extended by this amount
+  # of time. This parameter is required when using the account validity
+  # feature.
+  #
+  #period: 6w
+
+  # The amount of time before an account's expiry date at which Synapse will
+  # send an email to the account's email address with a renewal link. By
+  # default, no such emails are sent.
+  #
+  # If you enable this setting, you will also need to fill out the 'email' and
+  # 'public_baseurl' configuration sections.
+  #
+  #renew_at: 1w
+
+  # The subject of the email sent out with the renewal link. '%(app)s' can be
+  # used as a placeholder for the 'app_name' parameter from the 'email'
+  # section.
+  #
+  # Note that the placeholder must be written '%(app)s', including the
+  # trailing 's'.
+  #
+  # If this is not set, a default value is used.
+  #
+  #renew_email_subject: "Renew your %(app)s account"
+
+  # Directory in which Synapse will try to find templates for the HTML files to
+  # serve to the user when trying to renew an account. If not set, default
+  # templates from within the Synapse package will be used.
+  #
+  #template_dir: "res/templates"
+
+  # File within 'template_dir' giving the HTML to be displayed to the user after
+  # they successfully renewed their account. If not set, default text is used.
+  #
+  #account_renewed_html_path: "account_renewed.html"
+
+  # File within 'template_dir' giving the HTML to be displayed when the user
+  # tries to renew an account with an invalid renewal token. If not set,
+  # default text is used.
+  #
+  #invalid_token_html_path: "invalid_token.html"
 
 # Time that a user's session remains valid for, after they log in.
 #
@@ -1345,107 +1362,110 @@ password_config:
    pepper: "{{ vault_matrix_secrets[matrix_server_name].pepper }}"
 
 
+# Configuration for sending emails from Synapse.
+#
+email:
+  # The hostname of the outgoing SMTP server to use. Defaults to 'localhost'.
+  #
+  #smtp_host: mail.server
+
+  # The port on the mail server for outgoing SMTP. Defaults to 25.
+  #
+  #smtp_port: 587
 
-# Enable sending emails for password resets, notification events or
-# account expiry notices
-#
-# If your SMTP server requires authentication, the optional smtp_user &
-# smtp_pass variables should be used
-#
-#email:
-#   enable_notifs: false
-#   smtp_host: "localhost"
-#   smtp_port: 25 # SSL: 465, STARTTLS: 587
-#   smtp_user: "exampleusername"
-#   smtp_pass: "examplepassword"
-#   require_transport_security: false
-#
-#   # notif_from defines the "From" address to use when sending emails.
-#   # It must be set if email sending is enabled.
-#   #
-#   # The placeholder '%(app)s' will be replaced by the application name,
-#   # which is normally 'app_name' (below), but may be overridden by the
-#   # Matrix client application.
-#   #
-#   # Note that the placeholder must be written '%(app)s', including the
-#   # trailing 's'.
-#   #
-#   notif_from: "Your Friendly %(app)s homeserver <noreply@example.com>"
-#
-#   # app_name defines the default value for '%(app)s' in notif_from. It
-#   # defaults to 'Matrix'.
-#   #
-#   #app_name: my_branded_matrix_server
-#
-#   # Enable email notifications by default
-#   #
-#   notif_for_new_users: true
-#
-#   # Defining a custom URL for Riot is only needed if email notifications
-#   # should contain links to a self-hosted installation of Riot; when set
-#   # the "app_name" setting is ignored
-#   #
-#   riot_base_url: "http://localhost/riot"
-#
-#   # Configure the time that a validation email or text message code
-#   # will expire after sending
-#   #
-#   # This is currently used for password resets
-#   #
-#   #validation_token_lifetime: 1h
-#
-#   # Template directory. All template files should be stored within this
-#   # directory. If not set, default templates from within the Synapse
-#   # package will be used
-#   #
-#   # For the list of default templates, please see
-#   # https://github.com/matrix-org/synapse/tree/master/synapse/res/templates
-#   #
-#   #template_dir: res/templates
-#
-#   # Templates for email notifications
-#   #
-#   notif_template_html: notif_mail.html
-#   notif_template_text: notif_mail.txt
-#
-#   # Templates for account expiry notices
-#   #
-#   expiry_template_html: notice_expiry.html
-#   expiry_template_text: notice_expiry.txt
-#
-#   # Templates for password reset emails sent by the homeserver
-#   #
-#   #password_reset_template_html: password_reset.html
-#   #password_reset_template_text: password_reset.txt
-#
-#   # Templates for registration emails sent by the homeserver
-#   #
-#   #registration_template_html: registration.html
-#   #registration_template_text: registration.txt
-#
-#   # Templates for validation emails sent by the homeserver when adding an email to
-#   # your user account
-#   #
-#   #add_threepid_template_html: add_threepid.html
-#   #add_threepid_template_text: add_threepid.txt
-#
-#   # Templates for password reset success and failure pages that a user
-#   # will see after attempting to reset their password
-#   #
-#   #password_reset_template_success_html: password_reset_success.html
-#   #password_reset_template_failure_html: password_reset_failure.html
-#
-#   # Templates for registration success and failure pages that a user
-#   # will see after attempting to register using an email or phone
-#   #
-#   #registration_template_success_html: registration_success.html
-#   #registration_template_failure_html: registration_failure.html
-#
-#   # Templates for success and failure pages that a user will see after attempting
-#   # to add an email or phone to their account
-#   #
-#   #add_threepid_success_html: add_threepid_success.html
-#   #add_threepid_failure_html: add_threepid_failure.html
+  # Username/password for authentication to the SMTP server. By default, no
+  # authentication is attempted.
+  #
+  # smtp_user: "exampleusername"
+  # smtp_pass: "examplepassword"
+
+  # Uncomment the following to require TLS transport security for SMTP.
+  # By default, Synapse will connect over plain text, and will then switch to
+  # TLS via STARTTLS *if the SMTP server supports it*. If this option is set,
+  # Synapse will refuse to connect unless the server supports STARTTLS.
+  #
+  #require_transport_security: true
+
+  # Enable sending emails for messages that the user has missed
+  #
+  #enable_notifs: false
+
+  # notif_from defines the "From" address to use when sending emails.
+  # It must be set if email sending is enabled.
+  #
+  # The placeholder '%(app)s' will be replaced by the application name,
+  # which is normally 'app_name' (below), but may be overridden by the
+  # Matrix client application.
+  #
+  # Note that the placeholder must be written '%(app)s', including the
+  # trailing 's'.
+  #
+  #notif_from: "Your Friendly %(app)s homeserver <noreply@example.com>"
+
+  # app_name defines the default value for '%(app)s' in notif_from. It
+  # defaults to 'Matrix'.
+  #
+  #app_name: my_branded_matrix_server
+
+  # Uncomment the following to disable automatic subscription to email
+  # notifications for new users. Enabled by default.
+  #
+  #notif_for_new_users: false
+
+  # Custom URL for client links within the email notifications. By default
+  # links will be based on "https://matrix.to".
+  #
+  # (This setting used to be called riot_base_url; the old name is still
+  # supported for backwards-compatibility but is now deprecated.)
+  #
+  #client_base_url: "http://localhost/riot"
+
+  # Configure the time that a validation email will expire after sending.
+  # Defaults to 1h.
+  #
+  #validation_token_lifetime: 15m
+
+  # Directory in which Synapse will try to find the template files below.
+  # If not set, default templates from within the Synapse package will be used.
+  #
+  # DO NOT UNCOMMENT THIS SETTING unless you want to customise the templates.
+  # If you *do* uncomment it, you will need to make sure that all the templates
+  # below are in the directory.
+  #
+  # Synapse will look for the following templates in this directory:
+  #
+  # * The contents of email notifications of missed events: 'notif_mail.html' and
+  #   'notif_mail.txt'.
+  #
+  # * The contents of account expiry notice emails: 'notice_expiry.html' and
+  #   'notice_expiry.txt'.
+  #
+  # * The contents of password reset emails sent by the homeserver:
+  #   'password_reset.html' and 'password_reset.txt'
+  #
+  # * HTML pages for success and failure that a user will see when they follow
+  #   the link in the password reset email: 'password_reset_success.html' and
+  #   'password_reset_failure.html'
+  #
+  # * The contents of address verification emails sent during registration:
+  #   'registration.html' and 'registration.txt'
+  #
+  # * HTML pages for success and failure that a user will see when they follow
+  #   the link in an address verification email sent during registration:
+  #   'registration_success.html' and 'registration_failure.html'
+  #
+  # * The contents of address verification emails sent when an address is added
+  #   to a Matrix account: 'add_threepid.html' and 'add_threepid.txt'
+  #
+  # * HTML pages for success and failure that a user will see when they follow
+  #   the link in an address verification email sent when an address is added
+  #   to a Matrix account: 'add_threepid_success.html' and
+  #   'add_threepid_failure.html'
+  #
+  # You can see the default templates at:
+  # https://github.com/matrix-org/synapse/tree/master/synapse/res/templates
+  #
+  #template_dir: "res/templates"
 
 
 #password_providers:
diff --git a/roles/matrix/templates/irc-bridge.yaml.j2 b/roles/matrix/templates/irc-bridge.yaml.j2
index fb6a3a657f9ad5e1197351918e7fa39b553f5b76..32a258aabac791db6c2019da451d835fd1873049 100644
--- a/roles/matrix/templates/irc-bridge.yaml.j2
+++ b/roles/matrix/templates/irc-bridge.yaml.j2
@@ -32,6 +32,14 @@ homeserver:
   # Default: true
   enablePresence: true
 
+  # Which port should the appservice bind to. Takes priority over the one provided in the
+  # command line! Optional.
+  # bindPort: 9999
+
+  # Use this option to force the appservice to listen on another hostname for transactions.
+  # This is NOT your synapse hostname. E.g. use 127.0.0.1 to only listen locally. Optional.
+  # bindHostname: 0.0.0.0
+
 # Configuration specific to the IRC service
 ircService:
   servers:
@@ -204,6 +212,10 @@ ircService:
         # circumstances.
         # exclude: ["#foo", "#bar"]
 
+      # excludedUsers:
+      #   - regex: "@.*:evilcorp.com"
+      #     kickReason: "We don't like Evilcorp"
+
       # Configuration for controlling how Matrix and IRC membership lists are
       # synced.
       membershipLists:
@@ -246,16 +258,10 @@ ircService:
         # 1:many mappings from IRC channels to room IDs on this IRC server.
         # The matrix room must already exist. Your matrix client should expose
         # the room ID in a "settings" page for the room.
-{% for channel, rooms in settings.mappings.items() %}
+{% for channel, config in settings.mappings.items() %}
         '{{ channel }}':
-{% for room in rooms %}
-          - '{{ room }}'
-{% endfor %}
-{% endfor %}
-
-      mappings_keys:
-{% for channel, key in settings.mappings_keys.items() %}
-        '{{ channel }}': '{{ key }}'
+          roomIds: ['{{ config.room }}']
+          key: '{{ config.key }}'
 {% endfor %}
 
       # Configuration for virtual matrix users. The following variables are
@@ -370,7 +376,7 @@ ircService:
   # only.
   logging:
     # Level to log on console/logfile. One of error|warn|info|debug
-    level: warn
+    level: "info"
     # The file location to log to. This is relative to the project directory.
     #logfile: "debug.log"
     # The file location to log errors to. This is relative to the project
@@ -382,8 +388,6 @@ ircService:
     # to rotations.
     maxFiles: 5
 
-  # Optional. Enable Prometheus metrics. If this is enabled, you MUST install `prom-client`:
-  #   $ npm install prom-client@6.3.0
   # Metrics will then be available via GET /metrics on the bridge listening port (-p).
   metrics:
     # Whether to actually enable the metric endpoint. Default: false
@@ -395,11 +399,6 @@ ircService:
       - "1d"
       - "1w"
 
-  # The nedb database URI to connect to. This is the name of the directory to
-  # dump .db files to. This is relative to the project directory.
-  # Required.
-  databaseUri: 'nedb:///var/lib/synapse/irc-nedb'
-
   # Configuration options for the debug HTTP API. To access this API, you must
   # append ?access_token=$APPSERVICE_TOKEN (from the registration file) to the requests.
   #
@@ -473,3 +472,23 @@ advanced:
   # accidentally overloading the homeserver. Defaults to 1000, which should be
   # enough for the vast majority of use cases.
   maxHttpSockets: 1000
+  # Max size of an appservice transaction payload, in bytes. Defaults to 10Mb
+  maxTxnSize: 10000000
+
+# Capture information to a sentry.io instance
+sentry:
+  enabled: false
+  dsn: "https://<key>@sentry.io/<project>"
+  # Optional. A tag to specify the production environment. Not set by default
+  # environment: ""
+  # Optional. A tag to specify the server name. Not set by default
+  # serverName: ""
+
+# Use an external database to store bridge state.
+database:
+  # database engine (must be 'postgres' or 'nedb'). Default: nedb
+  engine: "nedb"
+   # Either a PostgreSQL connection string, or a path to the NeDB storage directory.
+   # For postgres, it must start with postgres://
+   # For NeDB, it must start with nedb://. The path is relative to the project directory.
+  connectionString: "nedb:///var/lib/synapse/irc-nedb"