diff --git a/deployer/group_vars/all/vars.yml b/deployer/group_vars/all/vars.yml index 6620af2..549835c 100644 --- a/deployer/group_vars/all/vars.yml +++ b/deployer/group_vars/all/vars.yml @@ -134,7 +134,7 @@ sites: - slug: synapse_test # Shorthand name to use as directory/file name # The site URL (without www) - url: test.zinz.dev + url: zinz.dev # Wanna display custom HTML as landing page? Fill this with its path. # To keep the defaults, comment line custom_landing: /vault/www/riot @@ -150,8 +150,8 @@ sites: # PostgreSQL #postgres_host: db postgres_database: synapse_test - postgres_username: synapse_test - postgres_password: "{{ vault_synapse_test_postgres_password }}" + postgres_username: synapse + postgres_password: "{{ vault_synapse_postgres_password }}" # SMTP contact_email: contact@zinz.dev smtp_host: mail.gandi.net diff --git a/deployer/group_vars/all/vault.yml b/deployer/group_vars/all/vault.yml index a642afe..2210c42 100644 --- a/deployer/group_vars/all/vault.yml +++ b/deployer/group_vars/all/vault.yml @@ -1,54 +1,58 @@ $ANSIBLE_VAULT;1.1;AES256 -37633930663134356232643631336635303363303366623536366661313663376233316364343030 -6663366266383139613065613265343537613266373863640a393764653365363665316266366138 -39653639316232323336303432316163346163313863353832323436393637306662306635613261 -3163343533333132330a636337343537393363353336656531633439313963376136666565653233 -34663563373962303639653030396365396163343837613333303965393731356436373963636666 -35643238616136636137393339386534303436396636303536323838636264643265356334393537 -37366634313866343730346231636135636439623737653036313236336234663237343738313231 -37663964623263663430616231336363396436353430353366626133363832303035623765636336 -63346539616130326561626438383133316262626637653066613032343130393865663839353366 -37653231336130326237326332366637356230623063333632303337333361643738336132393665 -63383364623361333037343130336632343433353762353661653063336434633861303339333135 -66303934323232613134343332363239656230656534356234366336346436653565316638303466 -61303536626335656166303063343438343438383333386632303436646638663838613433393738 -61313265626138613631666166613161336564303463623064393535333232353632383239666130 -61376564613432616466313134306436646636353261653063613966663662356234336261303534 -35363266643134646565333534656335646138623461366363326365386661323663633939623962 -32616565363861383036666364306231316236613139323961393337633134306636356333626338 -32363264366265643935613931613536383930623833306437323136353130666430656535653133 -33396333616439643332396237366435363561333230386133323336353933366532336566333339 -36663037666232343634326462333565383030623633663964396236386434613763666465383265 -35323264663434616262356532316132636361303261303031643134303431663763336631303231 -30336663323966653636383234653037363634623861353132623437643266396430366132366137 -61646661383938623331323062363639353366306538353036373531306634393831626335313362 -63623436343134336436626430396162636561343336663233656137653638333830643735663338 -37366539663834396364313336626466373634643035393036373730643631366463383266343362 -64656438376237383838363461366335623165343733353734613037663530633133336436663335 -64323661363361626634646263663330646365326362323639656263663963383666363330656666 -38353432616661623530626631646565646433353463383232373962373264646137336135393939 -33356336656561653638373434373438616266393566643631376133663730363535396532343733 -38323030343339356566356132323634316664373831373763383635623438613731356561643861 -32626331303465663933303232633865666533613235663930633930623331363634373031356164 -38363238396633303963383436353865656139393939633736336466626335303635366234393564 -30643732363335386366333332653462396236633433373136633831356362303431663862363162 -39396334623137633762326565613037336539343132636230623830633831393732303666363436 -39656534396333396330333936363261613765313536396538333937303765313632336235326430 -63613163376465323465376135313464623261313234636461333535623965323364373536393532 -66623361343636336461643965363436353735353931333738646563373639356537626239616633 -32356230383266303464346665326365376365353965306332653038626230616336376132343937 -62343837626363623263383531623832333634376663346339626530366132633461353734666638 -63393462386435313130353938373937303163346232623832643637373038353663643163353337 -36333132653039303133616464396139336565343564356666653761616634646331393539326632 -34643731333235316433636633653964383039626232343538656539313730656437656261666435 -36356639616264363664666538306634666338373730666439643534313063363431343330616239 -65383930326334316230633638373864666438313734336335623464366439653431396630316665 -62653066323734393631633261386435306532643133613762363439623731633036343264316663 -66306437626164373764346536393363633063366637313065653363663964353766353763373364 -37393162373837626162623863343636326335633137356539306638386432383537326137386166 -35353162306237633834306536343461326633653462666431656164636164643831353938323663 -37343132333037653134633230613733363733633538643163663233363331363133303864383835 -30633031356330323866333465643536636335393065643438333666333032633239343133623238 -37363231376337396165633866646336643137363966373534326164376239643664313864356166 -33323066326664383133306535633763343532323830636232626131346431653862613836396364 -3761 +66373461666135346666666530326134656266323432656132653364313132646164303064656535 +6465633065666166353361363463303663343935306462360a353765396263376263646630353930 +66656632353362366562353161343039393235313963366566393065303934313962366231613736 +3130313634383635340a373437623036623762353363356336306536653331363036653361336231 +65323164643239633637633661666533393765616465643664613436393038623339666233633334 +37333632383033346361623461623537393661383366633835393436353431356535636631343338 +30386433623463303232343231636164633734376535393065633166353238333035646335393063 +35656664336334646235376235343432646661616363646636363164653235393964336433303363 +66366166353739316437633636333430663937343435366630303164636366316364653731633436 +30333138346665393565333566323438626263626630663537323936393033646433633437653563 +31646332333238316632636165333834643131636165333037336537373430316163333161633765 +63303263323065636365396261643430626563636535313333336434376665623234646334663038 +39303935306230323130373531616563613964633933356465313436303064663664383965303937 +35386335616431363464306534356539396163366530373265303332653333393363646430383334 +39346563343431616236653834333839623231333430653465373430643833383765643435626530 +34376339393231633265633765326235613161343830386536306331313933343737366638373633 +35653738663965373437376237663161306532376665666339356631653333646466326166643239 +34653933633532623532323634383465663733633934646631353936356663333831373938336538 +33643433656466356133643563663232613132363535323937343064643064623865616237643461 +35386135393734393538306335376533613564653939666130373631646437343663376239616637 +39306132313466616265643830363830616138396435333464366237396361386135633931353763 +61353936353965373131333338323365643635396139373734306463346565373137346338343837 +62656166333465376637326433386363653266323665623565326535373162633735376534396635 +32353239323966313136643765613637313534396563346464623466373061393932626239646662 +34306566333336386464663833343934363030313932376366323031613235666335316334303632 +34333735316638303030666532626161663261343535303235643666343866303966323530663937 +66373163383731636634383338656130366433313831346130623835343262303864616163386438 +38626362626537303261643263663239313861336232343238373436303637373838626435363234 +66356632643361343366373430613138383730646239386530326636656565393333316263613663 +39376438386632626230316634303431386262346331363835336666633761353234393563346463 +35623932653534313434643535363462363838333563643963636232643966343737333536353536 +62303261363130326332303738623065636233313466386333346362353238633731383335643834 +61393366333235633136363664353663613736333737373632333661653430643930393137316332 +38373738303538323230323239313961616262663037373039323331353238366338666261633034 +62636634336139653864343335656532393633326537313332386335323361656431376265613232 +37343562613962626137343534343936353330356163306666356335303563383266336261303036 +38653935316665326631363234666430633030336266306232636532356138313065356461353634 +38323565386562636265383537326331653638346266346633333230353837323164663765396534 +30303438353165363563336566623265313464303937346530643839656238373530626338656537 +34666235336164623639646630326361313466303539636461336163343038643539316634303166 +30323636666436346433613865353938616430363531653739616439613733626265643039633534 +33313463363831313161383434316566386133653939656164366239353661396433346164386430 +36316235386464393064303635303633333436356462633932616538343637383331653064353661 +62633838373730393734386139626433623562316137633534653263626562343631616166663838 +39616461363866653665623236346464666436653863653166663565626136323731396230316561 +35653833353862316231653835373664306438333639353137623661336132383561376136313130 +34353434626532626633646236383134646433383665326135336166646537323733653930646463 +31346265333064633330386333656461653139636562366466636539306661363130313432656432 +30323939313432386131656561343430613363616461313662636235393934323337396136623537 +36323365613630363436386435653762313662643936643864376362613862336264383762666531 +64343330316635613931346464326462306338383666643630343262326661663232366433393336 +62343238623564343037633031386533656465333864343062373735363866333361376630343562 +35396338663264636466626666353631623463303439633638383534646137366332643463623934 +32656561313666323139316334613631393933373135633965623832653034373963393930616533 +33623366353463303639636530626134373364386464373439666164396635653135623834653132 +62383535373936303332616434303832663161323862373736656634366364663734383466666130 +3431 diff --git a/deployer/roles/build/handlers/main.yml b/deployer/roles/build/handlers/main.yml new file mode 100644 index 0000000..3fca8dd --- /dev/null +++ b/deployer/roles/build/handlers/main.yml @@ -0,0 +1,8 @@ +--- + +- name: Restart postgres + service: + name: postgresql + state: restarted + become: yes + tags: postgres \ No newline at end of file diff --git a/deployer/roles/build/tasks/postgres.yml b/deployer/roles/build/tasks/postgres.yml index a344d2c..7cd474c 100644 --- a/deployer/roles/build/tasks/postgres.yml +++ b/deployer/roles/build/tasks/postgres.yml @@ -5,6 +5,7 @@ - name: "Create database {{ site.postgres_database }} if inexistent" postgresql_db: name: "{{ site.postgres_database }}" + owner: "{{ site.postgres_username }}" encoding: "UTF-8" lc_collate: "C" lc_ctype: "C" @@ -34,4 +35,5 @@ method: md5 state: present become: yes - become_user: postgres \ No newline at end of file + become_user: postgres + notify: Restart postgres \ No newline at end of file diff --git a/deployer/roles/build/tasks/synapse.yml b/deployer/roles/build/tasks/synapse.yml index 969e378..ed3eaa0 100644 --- a/deployer/roles/build/tasks/synapse.yml +++ b/deployer/roles/build/tasks/synapse.yml @@ -17,16 +17,16 @@ - name: "Create folder {{ site_data_path }}" file: - path: "{{ site_data_path }}/site" + path: "{{ site_data_path }}" state: directory mode: "770" group: "www-data" tags: config -- name: "Copy homeserver.yaml to {{ site_data_path }}/site" +- name: "Copy homeserver.yaml to {{ site_data_path }}" copy: src: "{{ sites_path }}/{{ site.slug }}/homeserver.yaml" - dest: "{{ site_data_path }}/site/homeserver.yaml" + dest: "{{ site_data_path }}/homeserver.yaml" remote_src: yes tags: config @@ -36,7 +36,7 @@ image: "matrixdotorg/synapse:{{ synapse.version }}" command: "generate" volumes: - - "{{ site_data_path }}/site:/data" + - "{{ site_data_path }}:/data" env: SYNAPSE_SERVER_NAME: "{{ site.url }}" SYNAPSE_REPORT_STATS: "no" diff --git a/deployer/roles/build/templates/synapse/docker-compose.yml.j2 b/deployer/roles/build/templates/synapse/docker-compose.yml.j2 index 9290330..4f462cb 100644 --- a/deployer/roles/build/templates/synapse/docker-compose.yml.j2 +++ b/deployer/roles/build/templates/synapse/docker-compose.yml.j2 @@ -15,7 +15,7 @@ services: - UID={{ site.user_uid }} - GID={{ site.user_gid }} volumes: - - "{{ site_data_path }}/site:/data" + - "{{ site_data_path }}:/data" networks: net: ipv4_address: "{{ site.subnet_site_ip }}"