mastodon, don't recreate for now
All checks were successful
Deploy Containers / Prepare (push) Successful in 17s
Create New Secrets Template / Extract updated template (push) Successful in 6s

This commit is contained in:
2025-10-22 21:41:42 -04:00
parent b8d1b9432d
commit 2018de4ddb
3 changed files with 201 additions and 75 deletions

View File

@@ -1,70 +1,99 @@
$ANSIBLE_VAULT;1.1;AES256
66306532353835666663633632373037633561613261613139306436626532656366336362343465
3966653330313132663633663462363361373230623262370a623661366633623762656363616537
66323464363164323131663335313264396538313237303432653532393631306635666138316261
3738653338316132640a643935646530393362346431653966643061643334316238333632346265
66633336316466356566336132626332623661316337613634373036646236363736376561643733
66383830386336653236633933623037316632326266363136613031373439383834653134336237
66363039316661353837383964363163353433383734656564313139383764346533313564616333
36336231363661326638373963393265323365636665653034373536663232353266656365656338
66313034646236356364323238326265633933346530393430373364393837376437623138306630
35306266643835316136323232393630336330346133313963646539636463323862306236653335
30356335366365356439653130376139616336346363656436356333333538373036313266353163
39306365303630636135373731366334623165363336383261386334313061356461303664343133
63383763633566393662623833346662366235323836353639306266383532333736386161393138
36666662306233306439386639666434353639343137653831343666393463323865316464396636
33646238363236303531323131613731343262353365306232343634313637613634626162363566
64326238383331316365343566623464383732653333326534636365386230343836396234396634
63646235356639363036313839643632333066653634323661313263313331393332656131393065
65303338323466383161333237643433303961613266623134383936663866363337653535326133
62323464636638643163313064373736353263356638666434333135656133336534343932613234
32356361346366316262383232653835396435333837633737356335353837336632376337616364
35616365633738366466623835653866663461393738396633343235316231636138333663383364
63376164646563353335333133333665396132343439363861623734336335356663393735313837
34323034336431643362313332633665653837353635303061376235306665336362323630376132
36313539326336656134633564343538636264623932626164366138653035343732396464633863
32613363383366326332383835316666366430623235636536353337373035386361373236363036
31353865333933356561623661353133353864643038626366666431313831353234653430396331
35653864633263613963333734636364366336613430623032666666666266613538663665623437
30643562333561626636646337626234653936616438623738623364653561396638383564333262
39323265346263366530643132303033343835353334373865373561613539613461343962316663
32636461316234313832313635636431326134323638646164396537383963326439633063313063
37353062616233323932343033376636613039343734336630303139616331626431616330396363
65623565653235303630383534343739346234316337343233366530313238623139666538363430
61613833663666386161356331656131356462376463373432316331626531393136393838313065
34323361323836323561633032663833343537663637346330326337363165306237616335333233
35656530303666633438303732623232383965633038616632633164663461393465336233643635
30363334646161363234393533663064363364343838396562626232383036623236343664313366
35646532383164393365343366633134393061633362303164393034653862653535613761356630
65633634393033653363373235323933333766306165326237636530663737393063623664343031
63643538366238363066666566333236653362633861346136663036373731626136383530356466
33326230303864353838333136373736373963386638663164363139386638396265626365356535
35396236306639316631366461373235326665643565326539333739393264373733363163366537
31656366343831616339393065323331636136346236386131306533383436356566633830623163
37303036663935376132323733353433306361383234343962633165616538626564653239393137
65346236656266383130323662636565643033663933346337663836643765656266623563656430
31386365646437306362643965653631373862623266303165386666626430663130666130323062
36326331313838316339653231666138616332653564323635356366316237313662353531336636
31666263313134656136663862303536366631663965343565646637663566656466646435613839
39656230616465653465316633373561343237356637643336373535653438656137323264643239
66363066666161316362383737333638336565613230306138343735633432356661386631383530
64353161396463313532336430613862396537643436396562633665613736663965356335313131
63303563383734353331656164313638386135343336346263643430323932366133306261663562
32633363373537626633373433396565363032323536336263373835653363323661663834333365
65636332383232653933363736363131653032666135373436663834656337653739333338636437
62613463626437306133333632663662303732376364663339306637653534396433643665353366
30633332383136306230613435346536323434666431653834333639343234613631323031643138
38613536336465656232336238653532636664313766633432363364613937323337653464616461
32653939386537663635653733336463303538333431303537323633623834623637666132613030
31666539353762346335643134333637366533313833383634356266653831663333393661353439
64353432393432333865306535643261376536663064323163393266373235623530626138316237
63333631396234326534386238623937626661663265383631386662383866636231646531633562
64323762616431663664613564366562303630313137353838323064333966323062643233353830
37363763666530643535666235383062646163626164353037346365366332366162636563313361
37343861373764653633393930316666613335393232663332323035386431326566663038613861
37303061653936636234363937623162313731353961343337356663623362306461636438333131
32376633663639333534396162383438373863633664383266626537343165396435346337343935
62623232646432346362623430363665353036376564323734346536393430336135306335613238
35633365333430626134353535623363396330343138616530613333633961303930623633663662
65313032353232653233346665616562363138333639323562653035646431313365623036393665
3363
35396262346332373635356639356232373164626664656664663238326364353133623832373236
3634396565363530343734333836643638653730373833310a653239646630326566383833646266
63316234633062383132373165616431653733343830343866373264653033346338306230646330
3539343433643135640a653663663561663230363363663134383331313332656537663165343765
30396363393230353632633164646132353061343932393139616333653434383533303962633739
35623430333866666333363061386462366563663338386362346138633661336238336264613231
35313236326433356264656135383932373238356561633832643530353434346665313839613266
64313433376163616434643839353864386262383735633164656436666636316234343866643739
39623663643732346665366166656662383434633364633962303730373236313866666635303238
62623163653966366633653363393831646139336330316639363936653233626434343437653262
37323930346231636433396132656630333662353634393333656231333062373937343030313831
34386434653331306562613963636535396631626232353038303062656132326639316331316637
62313566336232636565633065663334356532343830376133653134373964316365653363336536
36393764323961396638613636326661393061613037646639303930356337633235383531363630
31323138343131656139313563633835356561353237396362616433313430306634313562323334
30643763313531373636396334353966316134366238323934323236303165346664333234393361
31373938663537623764666436306461386531663935323430303166613030646466336535353164
34393838386434346539623632383935633931633763633263303936643738336162643333316362
33343864653636323835373563626136306233613365376361343163303538303935323036303264
63663039353131346133373230363435653265646639333535376233373136383032663034383937
30306263653937366566376534306664613335383536343239663030633061353232333237376164
36323033336561363932623466393335326236613737366432346132613866383365653334643762
38663838666336666261323461373865633664393565346665656333663839396433303865663134
37393239346432366136326532623337306436323738366535633735303061656136333138633132
39303438666338643665623932396134323436323331376366626232613431656663663135346332
63363838663533623937636262383533353336383330333134663563366362316264343965333836
32303164393963623865346534326339356433643939666563393136653437366566316136646631
35333636653262633838363663616533653336363933663532366665666439393733313038626434
31376530343862393338323964363761626665663631653638306534656232313936383535356631
61336166653230653732623761323638643736656536373437663335623366333063383161623639
30353561623365363265336435643064393131393762376233353966333536653239336436306630
30633662393534356433616461656633623961653465326636663566613836353035656130306131
32303931313163323432373037663963363834373838363739646130376336616438373166623739
66363033333635326231326436633566313531663138336634643662643765393633306538366136
35366532626130333866623531666138373938383234656139343639336232383766323937653138
61316231313138663231656135313937663034623532343932383364343964323264643462623235
30613063393566326438666435373936626337366535656132623361616562376134363263373430
30656333346539303337633666633337653733313237613538613063663765346333386132373266
36343264393239323965383138633964346163666338383762663030303436336636373838646138
33323930643236666230633433363533663838386633353062376331636131313934373761316238
31363633373736303630653563633139386636393539353166616531393036663438323530643132
64323464646635303130383833343136313539306334366339393837383662313235343166353265
32653537356636653835383464663861353337633036613132393861353938326266343837653863
63303238666437613331356637353532323135623766336233343538356263666134393831623964
30306233373364616539343235643836613830363434653836633065656434373961323264393936
61396463626633343361633736326665393536636530346363653436663435326136343261393731
33333461323864613735653639376162623739313836323835336432373564653030633234343139
39646366356136353132303030616461336436343865316633663162386439303562376136613534
31626335313238313230666265653564316461623466326431646138323732623966653565313162
65643865636363373738623133656638396236353333376363333861663363613333373362333336
65353933323134373137643736323462613838373234326463303830303237616262643632663732
31363863666432626132376534313363356337306531353437393037626537346535323038376634
37343635323737356634396665336334616539643461303333383739666365636637333466383761
30386135333132396437303134353562613630643763656339323230316537363264313065373964
32623938326163366265373166633563356333613932666433656538653661653035643837306234
66646233626262353434616533393030303334313437373164653839363833366633653730663136
61623164633865313862646235623839613731373766663536383534353332393265636336646362
65353661303636663461363864383864336633653566353832316666303234323033323538363266
65633164363935633765343034383563633137346363326534383331656161333539636464313738
61333162653463653933643365303232613837303164653465353039386361353735646531323334
37653861613664633537653237323131333938636230306363626437353239303937373533663662
31333733333035386531313262616534313138333663353738343565383263366632636634336430
34316138613938623038393732363665386637323961366163336635663164626262626662323036
33643132323838666433613263623537323631633830303361653065373564313033386333633235
37643135333732303638323139363662356535373339343234626666613838613337616135626530
64626633393566623231616661393834316461656365356531623438363835306339376462616636
36336536363432363065623634343937346535333938353566653430313164306133343462633961
34616330393832626466643362363633333363353537646637653234303863636430313761613830
30346531356264316339333966313163643466656461336661643838636539336164326261363430
64636461303430626634333037623934363534666561316139363532333839316139376333636434
34303230653564356631336661373537356563373836323534303931663635363434663036363064
32623539303730346431656266663531613838643034323833646332383335346365623063616566
37303361303964636633316563303937623234653065333762336238643565383737333237313536
64383961386365356335663035643363366131626661366163313037656463613134653337373036
65343238653464663730623631626664393635353332383864313936333766393937386537333839
37363430626666376266383563303237626532666464373338613233393331386337316431376636
39666364346138613033643433663533666261396132373033633564393162386130333839323630
38313266333663393062316161663364613536616338353636613664346637636535656333326431
34343730333739316161383662393339643332383938303336633266353364366632306333663065
32346262313436656265393662366664383033626638623666383830636463373232626231616566
61303565353766373236343664376339353335343335343666643938313334316436376634316331
30353231303437316264363664386433356235643564663139323436626532633534323731613931
35663835366636396437653131306438336139643031313230353365323661656261636333333863
65636236343233656138353365373862373662643331353261366136383164626262336435346236
34316234656464383662633261653866616362326238333031636231373537316664356364346631
33383061633933373966373366303138336366656636663761343739303535663038333333353861
36613665333431643335626338666132383235616463343932313166353039386435303735653632
65663738656563643236646232633934613864343831663462333561353538346366656230356339
64366638383038636138613737353135306362636430663732313138666461636361313165633230
36666132363236356138366263633336633431373133356636343337613861653530623332646233
61663338643835333966633536623862326566663030373039323632326637636438656139336436
37373837666139313162626631396465363039333561666230303735353836636438333835663136
38393635303566656565383932616536353838316538343031356631356431666465633861343035
33643762646338636237656333316438323965653466353964393963363033623363346432663232
63653261376437303234643534313365366265396262626235343362353964613662626639343339
62346166663335663534306633616338373938393061363031313631383131376535663162306436
34316364393665346435663266623662323533323733626436383432656563393535363966363666
6132666337633438616136633864623237633437303761356336

View File

@@ -44,12 +44,12 @@ def main():
if container not in diff:
diff.append(container)
# when variables update for a host, recreate containers
for file in diff:
if "host_vars" in file:
hostname = file.split("/")[1].split(".")[0]
print(f"Secret file for '{hostname}' changed, will recreate containers on host after deployment")
host_vars_changed_for.append(hostname)
# when variables update for a host & there are no other modified containers, recreate containers on host
# for file in diff:
# if "host_vars" in file:
# hostname = file.split("/")[1].split(".")[0]
# print(f"Secret file for '{hostname}' changed, will recreate containers on host after deployment")
# host_vars_changed_for.append(hostname)
deployed = []
failed = []

97
tasks/mastodon.yml Normal file
View File

@@ -0,0 +1,97 @@
---
- name: Create folder structure
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ data_dir }}/mastodon"
- "{{ data_dir }}/mastodon/db"
- "{{ data_dir }}/mastodon/redis"
- "{{ data_dir }}/mastodon/public"
- name: Create Mastodon Network
docker_network:
name: mastodon
- name: Pull latest Postgres Docker Image
docker_image:
name: postgres
tag: 14-alpine
source: pull
- name: Pull latest Redis Docker Image
docker_image:
name: redis
tag: 7-alpine
source: pull
- name: Pull latest Mastodon Docker Image
docker_image:
name: lscr.io/linuxserver/mastodon
tag: latest
source: pull
- name: Create Mastodon DB Container
docker_container:
name: mastodon_db
image: postgres:14-alpine
recreate: true
restart_policy: unless-stopped
networks:
- name: mastodon
volumes:
- "{{ data_dir }}/mastodon/db:/var/lib/postgresql/data"
healthcheck:
test: CMD pg_isready -U postgres
env:
POSTGRES_HOST_AUTH_METHOD: "trust"
POSTGRES_USER: mastodon
POSTGRES_PASSWORD: "{{ MASTODON_DB_PASS }}"
POSTGRES_DB: mastodon
- name: Create Mastodon Redis Container
docker_container:
name: mastodon_redis
image: redis:7-alpine
recreate: true
restart_policy: unless-stopped
healthcheck:
test: CMD redis-cli ping
networks:
- name: mastodon
volumes:
- "{{ data_dir }}/mastodon/redis:/data"
- name: Create Mastodon Container
docker_container:
name: mastodon
image: lscr.io/linuxserver/mastodon:latest
recreate: true
restart_policy: unless-stopped
command: bundle exec puma -C config/puma.rb
networks:
- name: mastodon
- name: "{{ docker_network_name }}"
volumes:
- "{{ data_dir }}/mastodon/public:/config"
env:
PUID: "{{ PUID }}"
PGID: "{{ PGID }}"
TZ: "{{ TZ }}"
LOCAL_DOMAIN: "{{ MASTODON_LOCAL_DOMAIN }}"
REDIS_HOST: "mastodon_redis"
REDIS_PORT: "6379"
DB_HOST: "mastodon_db"
DB_USER: "mastodon"
DB_PASS: "{{ MASTODON_DB_PASS }}"
DB_PORT: "5432"
ES_ENABLED: "false"
SECRET_KEY_BASE: "{{ MASTODON_SECRET_KEY_BASE }}"
VAPID_PRIVATE_KEY: "{{ MASTODON_VAPID_PRIVATE_KEY }}"
VAPID_PUBLIC_KEY: "{{ MASTODON_VAPID_PUBLIC_KEY }}"
OTP_SECRET: "{{ MASTODON_OTP_SECRET }}"
S3_ENABLED: "false"
labels:
traefik.enable: "true"
traefik.http.routers.mst.rule: Host(`mst.fntz.net`)
traefik.http.routers.mst.entrypoints: webSecure
traefik.http.routers.mst.certresolver: letsencrypt
traefik.http.services.mst.loadbalancer.server.port: 80