From a0c23ae766eb7ac2e0513dcdb7ce05786f1c6aca Mon Sep 17 00:00:00 2001 From: counterweight Date: Sun, 13 Sep 2026 18:25:41 +0200 Subject: [PATCH] datum-gateway: convert to a role, de-Uptime-Kuma the health check 802-line playbook becomes 68 lines (three plays: the role, the Caddy dashboard, the Stratum socket proxy) plus a 345-line role. datum_gateway_vars.yml is deleted; its content is the role's defaults. Verified after a real run with zero miners connected: datum-gateway restarted cleanly onto the reformatted config, deployed config.json semantically identical to what was there (pool_address bc1qvrj3g84..., pool_pass_* false, ports unchanged), health check timer firing, and the Knots side untouched - bitcoind still up since 2026-08-19 with blocknotify intact. TWO PIECES OF DRIFT WHERE THE NODE WAS RIGHT, both confirmed with the operator: - datum_mining_address: the vault held bc1qdse9dsg... while the node had been mining to bc1qvrj3g... since 2026-08-08. This is WHERE BLOCK REWARDS ARE PAID. And unlike fulcrum and bitcoin-knots, the `Restart datum-gateway` handler here was never gated, so the stale value would have applied immediately rather than sitting inert on disk. - pool_pass_workers / pool_pass_full_users: false on the node, true in the vars file. Both corrected in the vault and role defaults with notes recording why. Comparing this config needs semantics, not text: the live file is single-line JSON and the template renders pretty-printed, so a textual diff is pure noise. Rendering it and comparing parsed JSON is what surfaced both differences. config.json carries bitcoind.rpcpassword and api.admin_password, and --diff prints rendered content - so `--check --diff` put them on the terminal. The task now sets diff: false by default (-e datum_reveal_config=true to opt in). Those two should be rotated. I also mis-reported pool_pass_workers/pool_pass_full_users as exposed credentials because my masking matched "pass" in the key name. They are BOOLEANS, and mining.pool_address is a Bitcoin address, public by nature. Only the two real passwords above were exposed. `Configure cmake build` and `Compile datum_gateway` are bare command: tasks with no changed_when, so they recompile on every run. The build is reproducible - Install datum_gateway binary sees identical content and leaves the installed binary's timestamp alone - but it is wasted work each time. Documented as the idempotent floor. Ownership parity checked mechanically against `git show HEAD:` keyed by task name: 7/7 match, 9 Kuma tasks dropped. This completes Plan 6 Stage 2: all six services in the list are roles. Co-Authored-By: Claude Opus 5 (1M context) --- ansible/group_vars/all/vault.yml | 367 ++++---- ansible/infra_secrets.yml | 367 ++++---- ansible/roles/datum_gateway/README.md | 73 ++ .../datum_gateway/defaults/main.yml} | 19 +- ansible/roles/datum_gateway/handlers/main.yml | 15 + .../roles/datum_gateway/tasks/configure.yml | 25 + .../roles/datum_gateway/tasks/healthcheck.yml | 50 ++ ansible/roles/datum_gateway/tasks/install.yml | 74 ++ ansible/roles/datum_gateway/tasks/main.yml | 6 + ansible/roles/datum_gateway/tasks/service.yml | 16 + .../datum_gateway/templates/config.json.j2 | 35 + .../templates/datum-gateway.service.j2 | 22 + .../templates/healthcheck.service.j2 | 14 + .../datum_gateway/templates/healthcheck.sh.j2 | 32 + .../templates/healthcheck.timer.j2 | 10 + .../deploy_datum_gateway_playbook.yml | 780 +----------------- ansible/services_config.yml | 7 + 17 files changed, 797 insertions(+), 1115 deletions(-) create mode 100644 ansible/roles/datum_gateway/README.md rename ansible/{services/datum-gateway/datum_gateway_vars.yml => roles/datum_gateway/defaults/main.yml} (57%) create mode 100644 ansible/roles/datum_gateway/handlers/main.yml create mode 100644 ansible/roles/datum_gateway/tasks/configure.yml create mode 100644 ansible/roles/datum_gateway/tasks/healthcheck.yml create mode 100644 ansible/roles/datum_gateway/tasks/install.yml create mode 100644 ansible/roles/datum_gateway/tasks/main.yml create mode 100644 ansible/roles/datum_gateway/tasks/service.yml create mode 100644 ansible/roles/datum_gateway/templates/config.json.j2 create mode 100644 ansible/roles/datum_gateway/templates/datum-gateway.service.j2 create mode 100644 ansible/roles/datum_gateway/templates/healthcheck.service.j2 create mode 100644 ansible/roles/datum_gateway/templates/healthcheck.sh.j2 create mode 100644 ansible/roles/datum_gateway/templates/healthcheck.timer.j2 diff --git a/ansible/group_vars/all/vault.yml b/ansible/group_vars/all/vault.yml index a0e560a..a2b0fcf 100644 --- a/ansible/group_vars/all/vault.yml +++ b/ansible/group_vars/all/vault.yml @@ -1,178 +1,191 @@ $ANSIBLE_VAULT;1.1;AES256 -35333539613236336636383331373761643732663835346539653531336662636432346132636539 -3738343939626363303936646239613531306461646431630a656362666266356534303466323962 -64626235663062393436356165323364333735396530343435373730613765346466386336653030 -6234333131383036330a663039613363656536353164323265383130333463646638396437356332 -65653330383235386563623231646535343461613833333765333336366338376264666139303635 -65666139643363356264353234343736623731656534636662616466313764633763303035343432 -32623965326532353733656533356566393834343338303833356334346533383531393435363461 -64306561663434353935386165393361613330643163323564383835386438346664323663663564 -35623032646362346262366333626461343364356136373231313635353665643838666336313766 -62663730653030326534393838343139313239656530316662323638396230323436396431306135 -64386263616633323061373331376536343261313330653061333662373034353564623934376235 -65363432316630636132613935663466366365613265326163383832613631303631616464633161 -64373661313034653338646537343164623630643039353533376537636264653261393464633765 -38376436366262373663303137343861383932356330356239326464666233303064666634623135 -66373430383061643463386265646666333962366366336534646635633365356334343238303930 -65316432386134353838333033386164643165366662393365623839616265646538333235343237 -63373236623963393937613333623630363032643365613561653638323030373435353639366433 -34326334643330336564323439656630313331623762373038343133613763643838643039656338 -61323933643764306339383733623939346466303636616339396534643434633936393563373934 -66646632336133386163613135363963363338373338323732333563643164313662633639633130 -32383263396666333639626366316630346333643039666431323164356364346566343237316166 -62343464373564303533653864653164626239383737303235353638346636356538383661643931 -38646538323431383638653532303163313032396164353139333461363066393566303237386239 -37613236376636316136346266613530363732353232313037383830313461393136306233363931 -35663963613630616530383865633330636434626230333563313362623265633637333261653632 -63303130323737633365646265393736613136383536383133663538663466643631626139663865 -34333938363430393763653937653561376362353633303962643637666162666538316366343132 -31646163626465643463326333303365313138626366363861663530343362366663323161656362 -31623361323033353238623462333031356265343239613834353864333365626636316531313238 -66343633393865316535316262376338346234633737366132313938356438383066356465303239 -64326261333935343337363331373366636438623966373439653432663030376236643664643865 -34393738343865336263666133613765353162353839393633346439356665613936643863323464 -64633462366565373532333336376666336263396362303639393061346438363035613534356334 -37376166363030393237373464356139343336333939346662336332336639396432346665373137 -63306539383830656363383539303366643335356133353738373266646463346265333733613030 -63383036343663623366653763636135326561663739303631333936313161396335373962643662 -31386331623466666262396132636265323831646333353038386131303033626435316634666662 -36353539383961623535333730653537633932613366653563323339333738643131393338313931 -33373964366638323239386130306666316333613233666337623966303830323637306534653430 -62383634303736636166376563626537346161663432616265336364336264373638306364336331 -35373862653133333637636164343030623664333536656433366563376330356431343962656162 -31646536626631666636383033336130373565376430386639313135373765383437336538313266 -65383038616139663436323833613232626531326531303937613931373566646263643634343461 -63393365333839663231623532373634643136383333373166356635356666353837383331383334 -36636465316536313765326562336539663539613036373638616633353936383866663231356262 -65313965643263666163313638626335363333623833656439633464343864333465313231326164 -30646530363161633834306633643132306562363065323032383066316533373963383763333466 -33613230643633346566396165376665366361633733366261306637303964376231303365333165 -37366633643331393537633563626164613630396663326233383263343930333232656265326633 -62373539306331623332386637646333326435393933323632313166386365656561356536663738 -35363362663937363661636437336532646437623864643463346238636331643935333264663365 -35353063643662363939396638386531386265336566373835646435353736386666646531373361 -30646136386138323530306135666333386437356430643262363234616366376335633638303133 -62316562323463346263323934363937336631656666306237626438626133346566613662363831 -65623561373231663262313763623965663036376631663662616634353664663762386666353539 -63323237303362393762343832396463343534633432626532363534396261613132323633353938 -64613333316436313063313561656561326139623736373439363363393632353564343361396666 -32623938383737623836393536393838346131343762353463386339336361346266623663353262 -63316362363736376639333638326433383662663866303638376662616335653764663631616666 -66663738636162353262373034373334303562363236373232306364393335346139396663626634 -64373735643537383230616661323238333239386330313231333833663062393832396366373337 -66313966356261383039623630376138643261393062393030346131663839346437363766333732 -63303136303037643931663431363435353261343133386332666531383835663361376165383632 -38333963653732613462323435633936353637336538396531616437393131333631663335613931 -34343236386135316336353661636266396434386563656433633935336330366162363563313738 -39303561323739306362383765303131623265626332613265323264393333356165326238633031 -33366464626537313662333166343532373735303135306563393737663536363862336232613435 -32613031396562333939303566343834323164396165373165363932323065623839643035373539 -33363362316162643264623937353066303536623962373433333430373436643862616636613537 -66653864646463653435366531373039373663333964636163633965613438366339613437613731 -34353330616337313037353633626633633666346363663764316163653635363335343237616666 -34663461616539376463613635346536366334613536326564626363663661313038636562303031 -36653837393233333234613131633735313739333263663532623563623231323239343936333831 -64313661376164323738316136623261353538323565383865376339366466393033373065613835 -34393339323839653430653335623664373534356232386262666437393234616362353438386361 -65383362346239626438346135663064643031386335633533646433326631386439353731653663 -33326633653363313232356233373531633737383530396439643139316164626566326164333439 -33393163376162623938383264653337633361643633306666646163633337366264353939353236 -39383035653036613463643633633234623439626365633761643038656339373362333238373033 -36626563373563363139386336653764623661633766343965346634653135306137393361386539 -33656261333137656632353739346462326364386330333536636634666538643461373766316165 -31383238353730356339353934663037373865363238373339346238623364383631313537386231 -66643937316361333262643230343965616663393430303661623161323361643835623862313564 -30646631396564383932633437303464666166636434303330303934613038393130666561343837 -34376164323633336432333664366631326239383463303366363763383062643565643464633634 -66313264666562626339326133623630366131333232383333333961323234366633313231376134 -62653962303630366330303537383639306263316630313862646334393531363439346233313462 -34353937303230373931616339393861323138333237633861326165346631323931633234346630 -35656666623261616564343733343764383032373733306466383763376564663665663731303539 -37373863613135326634333039333932633461613165623938623338623565313332376136343436 -36303037653935383630376362326335653466343233613833666361633661626437663563303331 -32363331663334616338643239356133396662633231396436636630343934306333343539646132 -65366263646563386563643562316337343130643661633730663664663564316535613531353165 -32666436326530323961663736306162306633393366306532613266323633373330383634656535 -38626138633335393266656638613765666665313561363231636261643936333033383533373366 -61626365636635653834306539303530383330346630363766383734346332326638316561303763 -63646639386366616230333263313130346663343663623536376664303364623064373562326466 -38383163326637633937663161393538616339326263306463353530303630333937326138363239 -62633535356230353439623234316562653237613130383832343735643661623033316264653362 -37633065313135656637616137653963623331323863363364663761663364663565623535343366 -65313164643461383436623038316466396632626661373438643533336234323132613866393134 -32366363613338646131663738643236613562663262333936656461323336303139616434333334 -38653133633232343164313661623466643061383161303564376638373138646431343634393962 -31306564396262383438643937353563353663353536373032353263636430363235313736653333 -39303336316438616365613961653737633234323131356339623265373463336662366336396364 -38333962373164383630363866343361376262316462333936616230316536396363316163653463 -37306461346136323431323265383030643232633062386433336261316333323030663234663063 -65623434613662306137396361616330333233386630313935653861333761323565646237343430 -38613139663035373563313530366632303232643030643466346531373333363337643831663736 -62636538343035643464396461326363646537393138613166323762346539333033633661383531 -62653634636666343661353565363266303430623131643733633232626230623466376337366137 -65653565626366373337626632346338396533343138393431346333346161353838386434643863 -33383935636132343764656232393335316431633937323533313338366461376438653136363231 -34643363356664373765376465333534653137383961386262633165636666353464323261396465 -37353064353530393037303930303430376530623364633832636434313264393135383536306438 -35316436616536396335393863363863653763303666653161383630336437653663636434366635 -38633633396132623663323137643338303038393061633961353064383765353735393432313766 -61343735363538316134626434326264383932393964646136306537313932316238326362646337 -66363234363334373737623361616235383231303834636536393836373466323265653339326239 -39333135396464346232386362376335333234383231343533393264346335376133313434393633 -34623039373134633032613838616532303130353833323330646165396631313864643831333763 -35633831626465316533346431616362366331633937393037666538633936343964643735363733 -32393939303931393362656332386234323634376534653435343137353063333037633033616639 -62643037376335316662613064396339393639386336616362623963373265383231613063356335 -63633432623061366237636134663834336165306234643537373064633561613561363963323031 -36653439396163333439366534653764616361313633343763323938636638656461616261343536 -37653866346161333533323436323063626534313539363666636232653639343366663663633162 -37343539386163666464643466326562363566316630633530363235663732316463346232366362 -31303037316265333862656137646631616163623330616565303933623731393530333230616533 -33356638303132313864343938313336626265656362613633623639653537366664383265636235 -36303633343439643339653833646536323161323638613139613734396433656365613862303932 -31353764303836653434653637653732363464373238376637393766323661333735363336336662 -65623030633433333339306335626334396162626161373637646337313535666431386432396162 -63333761363462643335633136316139626665633838613533366633656461623064393963346366 -31656637653436653631306230323630333531613465663134393339363930623263373031363839 -35393931313234393761303364386161623065326661323566653535343735346165643961303662 -63323436663930663031366131333361316339356463333634383937633535616663313333313037 -63363363643764633735323331373931396534646131323166626537646638333230346362656262 -64303962653265316530663531613235323165306565613866373966633038353237323933316336 -34313566383234326233313435336665633239666531656536326230373536666565636336653964 -37666533613165666262656637376662656339636538643639356435356332323964643731353462 -30653463326462373734313535643436336432623965616637643537666432356264666338333364 -39353134633761633461346665353161656436303764343661343530333532343739623830393762 -64653831366263366664323534646163663761633335396363653739386431303265643865373830 -35663930396333303430333831666433616366383366333032383232366431616338356138393533 -64613863383631333231373833616230343930393531646535303333376232633162333136646431 -34333639663032656562646561653061313132383832386266613431343630386530636362636330 -62626537383961666664656363343830376662306137336433663162323233616466386438653361 -34343138396237633138326633383335393330653231336238666365353530393232323332333837 -63666462613637313738653136333131623436653033396562373462373665653266366237653932 -35353939316438626233323561336230333330336632323062363436666239613137316563613062 -62393138373036636461393364663934633439623837366536386132663933323139396435393932 -66333662343965323338623531633562666631343963653233333637646565343634373337643636 -64303566643537383633663736393037353635303335393436643634393337396434393430656131 -61643830323039633363326565636139663534326434666161666231623434373963396161326566 -65626636353537343465343062336239313537376462316161343039373032373237313462663032 -35666335626337343334356530616236303639383035333362323035353862303863656331643630 -64663864653066623938323162356631626537663463616464663134613836633033626364313732 -66393065393365343339376637313362343130396464626363346330383164356538363833373430 -62363030663639343934613233366232363637323165363434373262356336663037306163663636 -64346534663833643932373733316331323032373738313637646464363563653932363735316639 -39386433336435316331373330343065396433323637613566613835356436333631323833313866 -33373332323632393239633363356232346634303233373663646536666635663233396335353733 -33336364646233626564663938643230373532613133343439636363323033373461386463643763 -36656234386563666662373737633537656262396234326232396636306139393532623531313431 -65663338663639663462323932653661623436306431323464663430613363303463343236326165 -30626635366639373331663239623763373966323934623365316563383039383737383262353130 -31616463353364353036313863316165656231613664373237373933626331316638373566383139 -66626634313234306137376166613939383664653536386532643636336466623132646639363564 -38373963653337393539326162383535373535376334386439316330386136366337393139336264 -64656337383235383963346335306632653837383166653737343661323237383065656137393232 -66626261396261383466336361343730616336626435363536613730313635323761353335633936 -63626164316462666461343038636633366136353864323135346335383034306464373437333062 -35626464333537313639356662316366613833343365663132303266333538346562326562323434 -65323230653334336239616163643036653537643264656239303666343430333765316631643337 -65356333346534623466343439333932656332306564613065656537386232636662373665306465 -6563 +32393162393333376133353565666661663262306566653830666366303432343431613035666166 +3638303965376639353538363166386236363033633165660a616638323233306330663432383233 +37316365353864356130653431323361303137383935356535326434326465336463633166376330 +3731336431306635640a633233353865303466393561396431366133643332653738663164643739 +36323936383031623134353531343930343964393438656238353836306538386633373464306563 +39323735646131373736616638336638343564376433386562326364353135373639316661653233 +66656161366438323966323435343130323265306262663035346563643965613230353563636561 +62653732633263363833343535626563663263356665383864356363393865396133346438663363 +30653332653935376264633165626463623033386633336435353636303238393332376163366532 +32663136383164636262376461303937326561383537383563366663313264316234633366303435 +62313965623731363262303837636239323466356362636236396232636666386365393064376538 +34333136656139653866346563376134316662343536656531363038343061373834313638393936 +64663165323635346133333066393662323163303462326561653735343331373138343565363932 +66396230356565346239346533616261633765316263653738393839343433336631363736643133 +34636533326362663365363933633664386266633539643733316163623933396262393235323962 +31623865343734643435343134373237346466356362316434376133306633653866343437656632 +34656261343861346463323932626135326666393565626537666365636537303131366434336231 +65363737376533616638356565373531643933653061303661373431306433333439346365356337 +61333635616137363137366331643965633261393538333631613830646436303432373062313434 +38373638613364313864663331386635633731663930373063633430303465366532656338356364 +65343631336338346438653239656134633239613037663261336134386266363562646134343630 +38346634613362326630613132623262333232373366343333376130333239323861353936666561 +31363638323461313236623238626366353636356339363633626162363539333139373366616630 +39653231623538663766666339666166333433646432663664336339666233363535346161636461 +37313066643964343664663336346332343463323937656635636239623265316431306330393137 +31336261343731616362303963376331316233303030613035653863383539376131333865333066 +65346639643233346661646563386364363334316661613531643938356439383766373132313030 +36363331383738333332643935613766393965333462383638653239316333383636613363303530 +32666536356332373737396131663531653938396161626266633062646664613963653630623032 +37373862636531643033303335383361333435353964376361376337613662366536326561623233 +38616637613136323538356666613531656635633166383739653239393266316661326634386563 +31326562313062343730643531663463383437626637313439333336616530363031636661366635 +38653637616235613136353138666665313031323735373364663164616636313461616236646239 +36613563316133316466313933303032316330353338636231383739613530666337663363303439 +38333061353966356538376566646138343831623131366466346338666461363066643162616638 +33393231383734386235653233616232346666323962636339313037643636346561363266353464 +38333563306663373664373833636265653135343465333134393732383936353665313165323339 +38323061323035643166356634373736376231663632346263336230303564323766333632353131 +64646164646166336435353064386166313236306165343930656332633365333538383133393037 +61623665396632333462393337653436316634656530303432316238353461643231393238396161 +33313736383463356538393836306132383738393338353036303164363938646532396635313034 +36303862313531353165653034313135393065306662326130353732353461333533383439663866 +30343539353539643036323363303638646338366164303239363766316562633936653330393466 +36393133303162613531643832303239303038323034383133313531633765643234666366643365 +38653831376334656466363564626636303931633434633337343430616230353938663539366434 +64633737623066653632313739373766333463363838366562333835326464653635653635663064 +37376466643566643737313265306237323663363761653538636462613636623666396531333063 +66663037306365383831316363633666666162356461623363613163373632383736353233393363 +39343962623835343335636262306663633266326363313735393766623236343133653032373265 +34636665633939613837666665383735346135373634643266393531386666666137626231396638 +38333166353863333938383163353431636630633037623139356437626464626330346138393832 +34326339373363313763343032343431643165616235376165323264383437666266376261616135 +35373730643837363331626138666565353033316132613631623931353264393837613436343334 +34393137376661343731653934386132326435343931383937366164356336313630663665643263 +64316265643139316433313663363130373766653337636237636638623231386161386238353664 +66663832383137333463396230316431353338353431323133643238363335653734323562306639 +31363162643630616336343362346132313134663236653664653461616566653433323763656333 +64333865626533323834323130343434626134303136643136326366316134366363306433303666 +32663064326235366330303030373163633836306435323630316563376161643331636161303365 +64313433326239386433656139313030323235333538666632663432313439393837666133313566 +62633666333964353031366234636134333737613939663463333632386361316239636339366565 +64393930313665343366623738313561306234316666316532373839653465336339393838326636 +61343638666263643434363862306364663162613637323931623661303932346262363037363963 +34303739646236643830336139656230346436396339373936393130323364633436363039393132 +32643365396134383666353935643530346130613563373731633133396365373364393466396339 +33366663663963376565313630663937333630376661356365356362643639656538336162363831 +62653764306333333137383435626639613035396232303434666163343430313933303839343631 +36373861363333613932653334326238633431663537313863333830323737373463383662323239 +65316161623933663134306430636435653661386333396262613737306537356266616338643637 +37636662373762393538333261623666356532633436383835393763386438393433336339613266 +34613832353363303132326664393064363961623130653439383031363163316132656665333337 +64613736353130376635646432343663653033376539616262383361343866386261333262653333 +33333136363366303564643633306634366361646261396230663231373231323163343139646262 +37333436393332316138643732303862646631643864613434373038393535333036366136363066 +32616331373761613766393933646536363137623238633865336466633639366562643236316163 +65383837303164323036353137393231396234313630623837663537346335343430343064373364 +36333365653936656539303634663066303362383737363130316663656162393733646338393432 +39643733666335376266396465623438656131373737613939656238323837653865316331353739 +33613334313037616533666230376536396230383334653338626663663261646234356237633665 +38383731663939353735646637646637623161353330653134363765376663356164646230353632 +63393634313633663365626634663137396265346265613163636538323031383064613165366435 +31396262336362346130303133373234336263653832633936316664666430393935393064356464 +38323663336434663963393637636234646636656636386263333438626337356230383138613439 +30343838633463663631326462646233656233313735383136343633633832393434366436656531 +34336132356464353232636664666432656261313537373635323430393934656633643961633465 +34353034663032613735343135323361343234663363306432393439636331346337656135316639 +61333235366465343466366139356536616334376362643464323230663037383837303064353833 +30653038383832393237316239633535366665363631363231373232353261663362336361616664 +33656131643263373465353730646561656464363535333361666631663433323638376364633831 +31306666343430366330623338616461626135363862656630336566306432626564616234346433 +64353639353162306464313433323439356130653065316134626435363938656331623831623333 +31656130316565663066363839343466303265396561636665623739356562383366303835636561 +39356433623230366234393332613364393530653731333133666165666538623662623666623061 +38356364333939666139626463633133386336633330336165386237616537353862373666373130 +32333135396634313066386637316330326633326465653463653839363361393833386264346530 +30363962323338333932623130643162386633386532393031626630386364366362306564356537 +38333461643836613036643239393636623832363966636131323131373332336434343062613764 +66313236613439616338373263336535363134343562356231613166623432393536343435346565 +37383966333665633666356462663538343930366163653964626266363938613436373261353339 +31366636626338333432663730633035353935623437353231636331633064303430303765623236 +36386434633437393066333336393534356438343562326665326563353732376566626630636165 +61356139366232333737376136663266666139336664623034323536663261366636396631393162 +64663834366465383562386632343537303263353565373534336430343266356630333665363439 +32663334336565633533623533336365313035643234363930323431393533623933626637393866 +31653432336635363938663039613630623239656566623839653062643034393032316235373363 +37643863373636666639386337666332633432366539306463346138323865306465643834343138 +31363264343038346161636563653962623130373836366666366135353430666266386361346564 +64343630623038626437623532353066336665636332316238323364633162653230393862663933 +65643466313139326566613862363833393534343536656132653730623333643732313438653261 +37633031303633666531663636616336313638306261663532366236386536616465666162623665 +36316231666166613264303938616262396234343464383433653331633466303530623334666566 +32623663653132616334646634326435363832346366366139336661366336353931326232383332 +35666566663763646164393962396535333630393366373737653562373937303965306265323562 +32623730663861323363663138343138613634313839323232313130353138643134616265636437 +62613062616661383262643632303839356535373232383265363565663830363736383730636430 +35666332333961303165653662336261343837366430626530306236656332393465363934366162 +32383439363934396336633430626366653963383134326636613333373536393234353938383631 +64616632393434666135656339656266613064313237346634353831336664666463373864633231 +38663039363632373733646534636262613132633739306531663439313836313761656139353930 +32306232626361616339383931646338313532366161356634373965656139356137616238623463 +37323336323131653335636565393133313162616130343039346536353333343635383234646338 +33363838646265386438353266623732306633643362333866613537313064356631393135653637 +63306432643164333365343461353166646462373131383935653533613433306539633865373363 +30666239373563646132663734616637383965343539643330356531376661633933396233616462 +66383739376236386362623531303531343735653438303031343530363330386434666137616239 +37626333323766626130623039633462616330383934393830623430393466656164373437346166 +64633234633661663736626335323061313431313638363439653736326563393362373736613036 +64636536363865626361313465326365316564353761353834623235343939376231393831333362 +36303532356266306434656538336663383163306631663836313532343335363966663137373033 +32303036393739653530653162653038373663613536366162353863326663636431623033306232 +63353437653936383933303733663235383835623364653637376566353134666239633836613365 +36313362653237373934633831636161323161643762623761643433373466383132613034663538 +31373561336232326463373761623537663833366534353937336565316133623566633138373230 +63643838653330626565363966373735656334313834363034633066393934653331366161396136 +34646536343230306534663661646132306537663132393265663636356638636332363730383961 +30396633333962353835636134343539346332376566646335353533303331363434623635306463 +33636535343938396533623961343465353131623338626233656632333733313732363633646130 +66613230306233383435326531363632313239306566373261373031663136393334626133303761 +66363263306139343837626433656237376631646533653963333834633138353234396631333239 +31323161373435626233643763643965656465633034373061356263346635376633343836333330 +38343139663938363036336161613364323161633163643061336136316663313666336161303733 +39646139663131313537303735653665333265323531353839393432656361633761373433613064 +38653233346433353133306266623534386538393466323334643464306632663336373166633661 +35313831616663353831636663616339643631303163343637656132313236616563373861396135 +65633234396439373431663931343134393739633733393631663766653530373031306363623462 +36383063336666326232373638333430316535363630623630303433393737393431633832316232 +61343363366634663237316666636165353838343261613231373363626633323235306162653165 +64383934636634653134366438383138346233383366386463626663313033313537383031333631 +35633834633639323038666637313431326564346566376333353931336232313739313239373566 +33613862616634663630336532616530643165366534613230623133653931383064363632623538 +62616130653135366533613337343030633663313030646630373633636339386661663762393539 +30396337323932663032346530303034313636326630643966363566643965633362633631333839 +63346461646230663337303537366233613532313032386264303736366262343937393261303264 +64323666306532346530313438323338643830353832373633653334316432353666383134313465 +64313962343464396131636466613130643530383738663564323734323534386435353231306463 +37633734306134386539666165366531656234333863653535323730323537613537363834363536 +30633065376437323364373538653765646433373733356163346531646665616134626533323466 +39343030616264646233633838343233396636626461616561646664326534653762363531396463 +31366163363136316338356135653565316363666537376438666136646635373366633338356363 +66663336643366366436643265633034626239323437396165653263653434313833393032393436 +37643334633639633265393865363731346561366564383430303332343734623130383563376661 +38386135653163343163653930396261376539646238636139616236303130363561326364663962 +33623739363235333633653865623436636437616435376439326662613037313730346266623432 +33363361666138346365313234623631383264356532643433353535386562366237373734623935 +32326666323363353132383230303633383264616138656363636261393734613133386462633436 +30303830336365333664376565313734666132373066396137663431333435373738366464313863 +30393132313937353237636437343935613861313635643637383237643531333638376533316364 +62646631306231346437663234363832393162383738356235663561376333656333646365323433 +66386561373935316662663130626632323930623161383964613830303538383836396135383266 +39613536316132653666396161363164333864343963366634356632383836656662663366613461 +31343964386333653631323733633866333531366336303062353837383366613434333136633830 +65653065646633613864643266323037373231373936646465356663383838373536623461393765 +36386565393038626661623264333036623561663362633161363064383263633931373265366539 +30373137383364326466666532313266343361633436316439623564653065353534373561313265 +39383630383666633138616666633031656663333734636131363338616135363136393366333033 +33396664613130383161333862633766656637383063643230393661323233306364626230393937 +38616438313664383262353735636138316538653930626639653232393531333738313564303731 +32306238336166333934336437303636643135346238386165616539306432336639343130353935 +66383336663738336562366630653330646330363063643632363837666233656236323237383732 +36316536613866623532633233393931333339656365343064393862623662306634336466383764 +65303737373430316238336139663637383133646438633833346339643239623836343138393933 +33636337363130383064366463313439386164316133666238346237313761333437663730373061 +65363733353863396163346534306233633764326462666234373732626232623361626438376336 +65653437353832616537653338356234666238663533373831633065356562373832666238363464 +31616139386533616132313534373534656335666230656264636531306163376164333265333634 +39366539326633613966366464633535363432303238343533653131396335306639623035393434 +65366134316636663238663862366165306132323339393334306435306465373636306337623664 +36666139613361306234366237356634366563666438346537646564653464376330303165316464 +65333030656639313263316637383233373630666536636335313337656266656164326465623030 +3264653937336633613533613866386139613665366337373262 diff --git a/ansible/infra_secrets.yml b/ansible/infra_secrets.yml index 8d15ec0..f7fa9d5 100644 --- a/ansible/infra_secrets.yml +++ b/ansible/infra_secrets.yml @@ -1,178 +1,191 @@ $ANSIBLE_VAULT;1.1;AES256 -35383939623164356565323465316566346532343163646633323634396364376462313461366439 -3637616136336262303234323464343434643234383132300a333665333836653636393166376330 -36666466393762346333363930386334333863616265363661383639333561393061313938373366 -6562316232653761340a313631633931353736383636326339656432333065663032323033326334 -39646438633330323662643834383438656134376363653938356639356338633635663831323938 -62653533613861383536346230613161393834326637623636356265633237323331323565323339 -61306565663831613635656661373535396564376561653035616362623333386338666432346634 -33373033333737626534366164306436363932653231346134616163633634633131646165316330 -65393031613461623762383066626566373733666639333766643131396433306637653063356361 -35343231356534626661623331653365643230646566323666633031323734663933643864336264 -61616333353139626462623933343234386238393437623833363461323834306233653061363535 -64326339356435626265363235313965346165353434613962396465346265346539343764663733 -31343234356331333536663239336334653864393132666264383263333365663464663931626562 -36343430656262313962633965326539633834306263363036343562663132393537343863313961 -35356161386234326361626165343234393837643364616339666131343364386132333763623737 -39373035626332613566396532343535646235636661663263353338633763666363666363633465 -61353566646261376534323662363062623962643062386164666136623966363535356132656562 -65653465373366636533336539333035346537346261633933626334356631393461373361623537 -34326463373766393965653639313063383764313736626366653063663466646161313365306532 -63353566636433346237393834386537396232383961613932666537373565653338363435383938 -32333438623332626163336631663664396430643566376363366262656432666261383039326431 -63633036393634646237393665353666666239653533393532646464643934373535666137373764 -62646535613563363939313666636466623762636439323237623236383165666630363938393666 -34336439316665326265623335383434323837326661343163643833663330663834376432333134 -32333737643364373035626430393963373934316663626666333837666161616138633032393663 -37323432636435383462383061346332373862376336323363303031666336646161633539643033 -37633962356130613138343235633564393330373463613861313638303633326639626436613763 -61383236643439616232613331366535356130373365643064366533613330383661623833303231 -64353532646337643630373361303564386166306639623137643534376631393731393831383261 -36373934623337646234353165316563303336373437626464356463383733303338643936376164 -63303638313766333832323764666431313937633930623865353331616536653930653336343266 -30333931336165393634633231376266373933646661306138386631663539336139333265663631 -36333562396239623236336333343935663866363063353036663337646431356537373434666331 -39356635306263323365333263386331656636356436373862616434356462376134363034663532 -64333633663662623931343363393233306331303066303664323034373333656132386437366162 -37633830626362326637623139396631663834623436646364363439356361666661396236353739 -39333766396132616333323566393936363137333235643739333639646234313266303062323536 -38633964373238646534626566366438633364636461343861303437356562313966626235326537 -63316438373461313936343634373835306539333436393337656535323662663936656638353838 -38316234663432656539636239363861396139376264303336356630396163353234656562633362 -39613032653163313362643733393232316530613533343535376339636139393936616263346561 -30356134313831316364643439373135393836303330303737636137323035386432343963393165 -66366333306262353763383838376662633766636532643064373962366665313761646336303033 -32643633616162316537376435386536316431343136346264643163373033336463393130383562 -39623635316333383036336538626636363130353733336531396132623466363933333230616364 -30633364393334643866393332346239646235373766346562653061633732326537343634363065 -66646662336661386432306231313362636535316466656435366639383030376365313364666564 -65666535663532383662383833633261343934383535313163643133646663396135613761336337 -64653433366164373461643038353830626139306566643438393933396339616361623062346536 -31353039633437383862343865343133336665633436366137663033643834303835336633616361 -30363863626463333437626165333338366332653838663464633964363961373338336462376332 -63303738636539396635613938366336303462326564663937656231346639326438326561333430 -38646538353362303062376138636362333166373931663036646438663937326438316338653861 -62356365633966623638626138653064663835656431613262393532623731656132343864663966 -31373936333031646131663436323036366637326134336132373565316330663066366237336439 -62656562346639336339363363643933633566646363356565366336633863636230316634663936 -38626662653131623064373639383837366538633339313864346631633032356362373035303665 -61376332313532353665373131613335653732343839366365346330363638366265656139373838 -38633737653565366165306562353333353637326530636535616566323061386362333266383636 -61636365386232306338663962633235613435613466643032323363646232306431646164633639 -36383139313363613630616662613734636465646130363933376438633839363163343866323032 -35356531376663386331666238656537613164633634633934616462383331326633333235626337 -33393330303532626132393239633735623963363562656163383564306461353330376532396334 -30666361353862356636636632383234323565376235343862343564383830326533373861303437 -63613731643964613530343234323661636133643838316564356338366566303261336330616432 -32613535633630303132313933393833636433373539346261613661626135356363303930636138 -39323837383863306264633838636530393632363936633938626465656334336333333961666331 -66653463343333326563356337373732643333333065353436393736613038346636643535383466 -31656535633765386339633938666639396438326638303961303365323032333564636562343361 -65303662343633343364366265646432376230356362373465356539623632653663373631633633 -38666138363837356331343061373237303337656432326633646565353337393238363362396238 -66633966383237653064343333396661653932386536383536366632326234303161353166633836 -37313438393263366436613066386235343034366433343432346266343137346336646238613462 -33336339363037343533616166616565333330333531643364393437393637386330626437346135 -64396334656664336535373764666535373732353639326433646561616338323633623138373832 -30616363303834643532623362306362326230323737653563393838653234373861373933316538 -64376430376161316666396336373662393237383531353361393435386236636631613336386566 -31643637623333623364323734323961643863623532613432386662363361316134626533666339 -34656130633462616337323938626439626235306533336264343138356439633065313434616132 -63646664343962373365663738356233663135653965326534353665316531393964636132393932 -36633638636236326135323335646535396266666433396462623963656664336539386662373233 -64363566363863376466316338316562393461623262393130303762646334336463623632393238 -65656138396536373132363633313636643864353266356266626266643737393366326538353237 -31333961376236653263613930613432666531366131623834633632646332316133666530646139 -65616466646564646437333730383836656566643465303931326665343764396137643338373631 -62333266326265356562656430666538376134356239666635393430343234363231323938393331 -31613463613936656138623535303731333535323130303835366465383665353632636138653338 -35663132386634313538326130343435313131303934393434393736353531336261306265303264 -39376537636566333563393032336534333635346432663235623530666264323930646361313463 -39343437313932323064666632386137353834313930343636356561346535613730363865613433 -63316133663935373238373566326363343130376666613331666361326262353266653535343866 -64383931303037386165663439643232656139653832303239383235383637336664313864663935 -63366631303536336530366438333762393839656435366161353838303732386466356238333632 -34646463646535376139663136613562316166356138343939633935303532326536313033643639 -35653765326234333832366165363962376263383465313633313664336636616430313138313365 -31376535613130666562336533396636646161633932633030363437616337643761343439616338 -62333332376465306264663137613265363432343538643430333764326562613065663062613665 -63643030383163343231353964353264626434383762346639366335346465336365366131646131 -38633962316232663530376133383034303465313331393561393636386663623861373161376366 -37306533636463356232326430346538346136653264343839356662643435633337313232616561 -33633331346166303038656135303532643531383466346334383665613662333431336362333334 -66383336626463653136353861613832366338623631353930353432323338663834316436373230 -37393135303037663035303633643439653238663038626135623436303435303361393064353034 -35663230656434356434386462363834313137353865313831343261623466633861303336366334 -33626164313334306362393461313633376464343037646534666339386462666634363563386661 -37373138643432373834356335623864313561376131633161613035386166623836613339333563 -31613934363331633537663261653230306539616238313837393762323932363365326238353131 -31666564303666373163306237353136636430313639313931303339346335653539643265613230 -62643836353432316165336665373964353762376432373263323666393333393564323932333638 -33643763613739323134666139653862396436393836383232303564636261393161656163653830 -66653237313262616464656437343465623961633562376638626432663530356434396463663465 -39386261343933366666356664313339373231326566633165306632353535363436313864303936 -38613636326666303061616337666436383263363931323339646432373965363565333763343631 -37343566323732303830353537393565306434363130323335633837663762333431376539633765 -61363939626234386564306539636637333137626133363139353235366238326633623062303833 -64303832643830646430333061646333633039663634336263396563393437326135613932386634 -35393639373631323435373864306433373638613836396664633537323636653531616534316465 -63626661313733333431333665663165646234343438356134366131353234366466373133623639 -34656436306433363136666633616464373937633435616534376536393233313236356634323161 -63633632303562346566646166636664376431396162663765386532613832326339666130666536 -36663865633963613536623637303061626336343835646639633031366333393132663033396533 -38383862646631333262366237323234396465356531323363653464643361326362366231653739 -62643738303734643033323362656230616466353161663136623864313136386366376634653664 -31363930373530346333396536623037303162313934333634373033326432373566373032643964 -30663962353664353062303935356262363333366437383338373961616237663361326631353565 -37313936373033323131303161343139653565663466323830663536346665666232643163613562 -30643061653363663864383663326563306261663061326366383731366463356238373539383935 -65626464346366613638623730383631393066393233353130396636393438373565383266636439 -66633837626461623335316438393432303839633234323065396533343466373962633566643032 -35353939323038333434316232326138326266343662636130363565343463636364613263383438 -35653736333339353831383733393161356533343138336161383435333261613262306135393565 -66333134326265376433376538373531353966396138656265666266353737343936366132623633 -66663339616263623139666236373563363666356236383538316363326635396332373161373932 -31313430313065353762646538383361316563326262363833316434343965383032633139663634 -38383430336432373031636635366539663337666330663361303964653331376430303263613461 -39303832306463356465366237373338356636663637353835663336656331366638656433623462 -34623761366365366634353635333632373162643330633435303466326437626138663834323531 -61663433656537366662386134393761396162326265393465363131393333623731393534656338 -35356132323062336235326630353464393434633633343932613432623536343365626165626432 -31633732316364616463656430623763323039623835343164326536316334353666616237623535 -32303036653936363933353932323666636662393231306138306239653065623338336662613633 -34376631386235653161323331313661656366386635343264353535623439383734393363666239 -64303466393539353862626436643366306564336638346432373661336537353033613036393630 -35383962663363366665393938666266326464383936653539363838623338366466626439663438 -35333737356234363731396162353730643665666630366133633839303836313064306330373233 -62613363316238653534313739633033336134386264666362393061653434356637643736633863 -37333766646666626531323738633161366537306539303961373037656461323265353032666338 -30383834386333656334376361643338333662353461303932373132356133643934656466373864 -31306466396231363132636463333633383939376462386230363661656164666331323333363435 -33383262343238383265653232653538643964346236643031386164616364393732336637636239 -39663333646137313933313562626265663365633633653465396234396563656539646630346634 -63643461666365643961623936623364373334663162366537303163393665303633303562336361 -38323431346334623835396165653232663361383836663633386361616630633437623332383732 -33656139323339613164653433623237623939633230663735613063623131623632393535353066 -31633234613563616566396262343334313262366434306662613965316135323965643732356130 -31643437396264303831653762393930383431323062303032333666653761623866653762333663 -32633862383763633663313166313365333963636233386430366165643635633938306533663164 -35326561393265393830376434393235613265653764636538663165326363636538343630323763 -32396531613238313736393462313736393535613662353365636165373831626466386535623433 -63366338616637386336613435316262393561393139336331323132613835663065623637333833 -62663262653536313334623736343535323766643235303865653864613862663664386664643934 -37363832653530626339313336363639633863656633623838653564666135646333306264313765 -39613331313432636330383066653431383333323265623233633434343066323764633765663832 -34653434323631313261653234353437353762616466633463383835313034336234326666303864 -35333034376131323436613735383433393266613966363432646663366636303564666532646163 -38333963306665306438333034313933303337363331376663633333643161636236343662383361 -33333933346665613061346634666530323830653732356231306365613436323263316462373734 -65366462646532366638366235646533383235346463613164393630306636346232626264323932 -37343631656361633235333338613933396565376636343932306363623635373237366639633236 -62653537313134613239353365613239666466616630653336653738393032646263336561623861 -31333434646532393963346238613662343737323831393136383736636631393065306664616333 -32643666393261623262326562356631353432353231383161613964383566643466323962313238 -33393531363135636362326434383962633463633039333664353865383231353634633535333738 -62636432646461376431396638333231643164306432333132356131316538303366343333396564 -35373732323633666263663064356262323432653462333834636433613231356637626265653866 -61346366353165363639633466336463313462653137613035373430313334336262626439393539 -3663 +35396230336432656135363562623433303661376462666131373963633839386238636162613065 +6563613965386631663235303662636261323635393031620a633032313564306337666631646130 +32623664343966653866643438613965303936616234313036303061336139633535653333636439 +3432666530356639640a353631666335653863326232323061663136646332316535656437336235 +31623433376561633931626537333162323331336338326332633630343530656364323536303336 +62383763643033383138333365336130356264626661663732313561323465366437323164393733 +38333532376239373861613566333466316234623564316434383434393064323330663438393139 +33323263323038376135623439376132663637653634613465653865623163366365633861336161 +31323337656463396464303963353236383638646438646531393934656137303063343238363331 +61656262313037306531343437306361646637373864356662386333346134626637346363383931 +39386565643335633863396662363264633432646336383235303466616262663533303965623831 +39333563353431636438646639376663666439343161396163656463366333373362313466626465 +36376665653561636135383531336236643461303261393534373331633934346438323035663637 +63343634376532386532633435616661656336313966363566323937653533613665363461306638 +65393366346662356264353433386534326537363436313836373735616663303131643063313064 +61396634623262616661333365313466636332653261666539653135656166383933373436333032 +64393634396531656536323436373061626531663436313630373865323838376639386430376331 +64306138653931383335366130386334386236363062363631333465303635303531386261383662 +65343236663334356631306439613263653162626536303163343463353431363766643636653166 +33613439643634323331323165386337316463383232646232616439306565353866646635353163 +30343965316234666164633863333632376561383638323639353361313263616561613335316135 +62326466623134313236316430303861356335346633333337373639343766393639353431653061 +39363266663732393434326539353032666161623265633464626237613364396239626163343466 +36303364326638346230326632333636643866663937373864326161663765363535333761373138 +36333034623532616261613336326134626334313063353165303035383166303733393939303231 +30643731353963303839623265336663663436643839666366656661313232623036643232646465 +33666539343565363464373530323033353330343139666239623663646166373733363736633335 +61316134646234653638373639356665396663376366366366383831643938633933656261316431 +65346334653864663863333239383131326665316234363536356234373266653064353562623934 +61656632343235376235323466316562336337326637386534393436643664396634326261643736 +65376264376430333461353336656539636133343933323966323431376638653161316535323862 +65383661373763336638333461303433373365633161623333326535343932366537633362663431 +38663630336139313831656634653736633162353038333438643533633962633166633330333939 +38636266316162303039303737666265633230373364316362393562383532393539376133633137 +31366562666337313866343662363732333932643866646164633964323435393139633766376165 +39616262383366376164383334353633313431393830663962356165633734306337666330386235 +61303664303231346133353130666132623533343938613962363334663466313833633430393337 +38393631326534316363333966366138313836303830393763376633356234353335353366323962 +66366362386338353830346232303032666265343138313836633539333763626132653065656136 +35653634616638346138613464393464636239633762346236613030663766363839373134323730 +34373936323838633035373764373461636533333033646439386665653539653066616135333664 +38643964613966623833653233343464333464633134353431396536656432353738333761363932 +35646436323565656463613433353563373936316130373565636638333237373038613435633765 +63393538613531323063383434643739383134643863313739343863396437333461343936653666 +30656161656638316534633264626338666431333035633432346666636235343438303936363738 +61633838303238346336316365623062356464393463386237366664656134626231633831313964 +39393663626337366264663462663532636365623834386337333538633833633337646138373331 +30633639313633643233386664643033386136306265393233313236343166373838393165316234 +36366339373730343933343661353462656165643361626335663661343666313762613534313934 +37333764363565316163656334613631633938646564323535336164396438626261346365306233 +39383338303063343839633161623631343165336466383838633935323466613831313137313732 +34303961306638363233346436363432363366666162326438623962653138643661336233303464 +38626464326331623735313335356637376633373065366235303834343661633866303965646236 +34373066323464396363663562363239343261643930306632356566656364373231323039316339 +63656630356566343131363935396630313632383137323263363936383862623534623532636563 +61616236346237373031343034646231663833613132356362303532633062356638383266303438 +38303937376166663333653766633165306631366333323831333534613438363063323839633263 +32363132626335656434303130386330626530346463616136393137333863393965346639366261 +35313166356437393163663866626437383633323031373931643439623866353162646566303739 +61373530353264663436643937323431393762623933383233383833663235656434356639353664 +31336230666464396533633735313632663064333436306235303334653064303237303737636132 +62663461383761303863663538626262313038343739656262306564653034353031383234666534 +39643765393634323937656263626463373865643561376235663131306431306564363463346266 +61313835623933336436636131316130346337623835366366343735613562616137643466616631 +65386234656235383639353432333663626538303564303065383064636638333466366663346535 +62373034353430393733656163303933393332373030646630646638373861393463663434303264 +31626439663239373732336330356131613862343836363232326663643436643264323531366530 +62346532633565373961666464626431386431623038313464396361643934646332373735383339 +31343333623739623437356431623439333134333932363734663734636239623930663234656562 +63633561646362643738306632343732636166303636383939626135356536356134656262356636 +36346338643433393462303162343737643330656230643339386536393738353161303831663338 +65346262346136363565333261656164356664323533626537363562313935653766623535313361 +64343637376530333833343935633338303738376664323363643131383938333636636365333134 +33306363396233613164363461616238616364633461326666343366343534663166646439316437 +30396236333236393466323639663930636333663261373563346364613366616336643335646139 +39613632663131323432663938373537663335643934616333656662346432353766326631643034 +35316436653765386235366464373565386463333137343039653732386235633162373834383730 +66323139363137333835613132383364333437643332613930313463343539393736333336363039 +37333136373933353932353637663238363336613133626237393436353762316463633437626130 +33373762643736643465353030653538653262363531643935363836396631653431663231373636 +33656637336535646538383364393165313461616565316330653362643037333635386433626566 +64346166393130636661313731343436383139663831323031346663613761363637353537373632 +37316135333930386632613039356465353761383433333465333033646433373235323932343333 +39643532306133383665643838303366613631386439303862613963656434616461316236383233 +39356665383463356435646630313932626263643037623038613662383536663831316537613038 +63336262346361326664333432386465376634383534373562643238323462633334626366343761 +65303264316332656663616161373335313863396363643462656661613766306632636138623234 +35623666313130633836366161623862333161376464326166616539633835613861343038363736 +62646661393837353266663962313836326162306665323230353764633965336634373934366230 +31633364373164653163626162353934333933303332623564653362396665303961393039343565 +31386632363536373561643838613465633462346539343266613562393236626166383332653335 +38633432333535633532363239653332386565626232653963653930623735633632356264653463 +38376238393961653834616134376462363862633462333265663932653338656362363461613533 +33666137333639616237306263366264623236343732393134643266353331323634343462613438 +64616464316535363766666331373638313566643132316131336337393131346334393632633366 +32633964616461366435643234326234366434363131643437346131396139323331626237396365 +61666437643335396432373932653066663862623035646365343561616630663835663161303537 +63653134303134633861393036653464613265646135353061343663623964333436663834396336 +30313063336131626534396438393731616233333365393965383863323461303561356332363763 +66313863373164663734663462393431653864623764656536366266643231313765363430393134 +33306565646532306639346635323461313736663533303266643433306634326565383232643939 +65623738643739353363653266353534323332363037373834366135643537313739353263636638 +32653234353538386461323632613536366434613262653538333661313333363539393664363363 +64656461356661613161383562653465353866623961653232386265613864343562356639336339 +30653131623130633332343931343537326636356134303336306139333736303763303533323735 +37636131323530336264356264383263343038316264646634356338353761383033646631396364 +62303330386362623436343161353731623435356331373666613335653761653366356433373564 +34623062613439376432303765333763346662393866326337613061616138396430326133376139 +34663337393938343563363266386536616334623964633132303361393137623936623434393562 +37383038666166643537316439323333373431383661643863653034323330366565306630643161 +34643931373966306539623361323261633061363837643538373830343730646534366435636335 +35303862396563333835636431636433393933363533643636343265613638343933373438323563 +64613937666330343038343437616131303630323961306135386264363361383163393836353963 +35303064333065373533366535366361393436393535343965333865646137366166376530346436 +62386432316264663532333465623265313734333337323038613066663533356638666662323334 +35353165633564666130353962386439373863353535373236653338646633356531373230373262 +38666637663661396538333031653966616365353961653530613465623362393932643064323035 +39636534663464363064323862336633663038393834663333353235353562363934373739656664 +65653362346632613862393133316362366665646130326232313138323237646664383565366466 +34666231346433656235363362313434313438396361383231656135306330303035393530393530 +61643331626464646266326239336565613562353462323834393731326339383461313164633930 +31653633373633333539373962383866663739653135336463623837643165323831366562326536 +63613233383533636338646466363962313933393035356339316162616436306138383262633430 +37356366636662363231366532393763633564366461383162613539633734626563303864316233 +61653339393465626631373664306165353964373966623733386532636233346535326132366261 +34663036343665316234303439313064643939663833386633366264653163353234356237343837 +39613134623138616264613732383065623434303336393866633836306432663562393730343833 +35633139343130343236653931346266613665616230633032626665663031313262306530396364 +30663863326632633261346363633838653339393239376462386631303865636364616238646663 +37663033363433333531353332383866383065363337643265636264353562663635393766303265 +39323832663261653831616561333639373838316138356333646439356535333531626530633238 +33623039666433633436363365666431623039353065386564653139336138346136333238663866 +63356237373130343163303936643562373037613361663834386562353337663061313934643430 +32646137636139646263336439663730393737613061663933386165343034386161343333623834 +33323163626266363136376536616362636631353264363736663366636266653238656362633934 +30373664643933613637346363343964346463363036313961633961303832323834376337666630 +38363862613136396663626436303237396435333464303938303562333034613532373134353233 +38653436336461386139303864393338656661653137646137336332616435656638393231323838 +62663430663330653963313939663362656430303761656633343837306265366332393030363930 +30346439393837363333636136353235353463333563656332633236663033633835363531633261 +61643632396666663934346139373235346261626339386431333064333632333034333031666439 +66336561303536656462343363653136616562306362333662643938616437663938393933633463 +38636339356565663532663235326266386332353764656639363165336634653639336463616362 +66393131656631646133376461343438386162306430613561323630613865626235303438346233 +33373839323732666437363333346336663963323066353561396338383633626138323337383032 +35663132623364666537343036303136336333633864323834633265343936366631363865333962 +63306433333035363565303866333234363038663934366361656539333963373932306535313638 +61626661336330393265353064616263396533316361616534343566613833363061346230333036 +62626130383630306361646531666436613461333865343131626465323361373163336539343163 +39313036373236646162333563393561646663326631613333646238626463396364343061383233 +31373365396535326131616237323636623364633263386564613763623636623138386430376364 +39326637386237616332363531393534636262393336366335306665636466346134633365386665 +33646266386635636361383937616630376530643237396366666231313930373939313566383938 +64646436613039633835363966343838656461313834643438356166356566663861663833666137 +32666437626637323766303962303164393565626362656430353439383839313166303966366433 +64383730336566633336303966376366343332633366373662353337663965616333363033393765 +36306536316135303164306164313239333938646630633864336237346161303963376531373464 +34373465366231336365323030376235306662313433616433633962363564326262363631666136 +65613538656534366136303030303339383136323137633934633662646537353235646534313332 +31366365613533653339646131653239343663346239613934393666373536386635656534376165 +64613638643338613738353263633664636164353265616536626132346663636133393137616433 +33663635343063373465303936313731333765396137393235643566656332666634636462386461 +37323065373733333433316463663635653630656131313235386663306134373364393765356239 +38393964346361356135626331653161633536333463666463653936656531313463666632393061 +36383166633935343063663763663536326466646663383763333161613165393665383030396262 +34666631316262616131346233613035343236613838333036663661386464346136383737323036 +66366632313130646430616563653731346362343339363235616335393964633335326633376135 +34386666353864303161346263663265393731326332303231323934383838343934376339373139 +34663666363335663165636237303330306338393136653339633733663364623461303134303839 +62366337396363613737623138666565613530643861653830616332656435373233656266353461 +66616636393864643338616164316131623464613466396562386238663364623630303338643837 +64633433666139333864313862663832306230663339643933663530383939396230393032323861 +30376464336566303833306664613633333335326562396462326437343437323032363065363237 +61646238363436383134343434353534326537666431333430343065633035353437616366383039 +36616362353536396436623835656462353231653838336666636335666333653130633330353232 +64643733393034343139373733623365333961343139353532313230613134346365303061616663 +36636465353234316361376261303834333532623336646335306636353965613361366430643436 +33306135633538653034643361323235353566636661363436326133326238633964646263376166 +32333862623239333661393930346638663461633762653332386631616666366333333863336239 +63356265663437343037396464396365323336313038336636636562343262396466353333313765 +33396636396562323338383561616366323832616566323464653035366432653833633831633234 +30636237616332383434623338616639633732643134383637343162353234316639333733613033 +31306362623163373631633965623631643537393662626538663966373765383530343064313165 +66303337656537343539323565663636333139383033393462326331643234616138323236663630 +62653163393733613838633739393439343464653738616161663330633236626234313034346462 +31633539303139306361613839366234643535383961346130363433633033373434633565613063 +35323839386463383438663131303665386130653332366463363330363530653533313661363361 +63313539653239303861356638303236396138326131626564666337626332383462633732373465 +36353966383036663733333336643633666633346233363732633837656334316331313032323064 +3739636230343038353664353163363939363465326433613561 diff --git a/ansible/roles/datum_gateway/README.md b/ansible/roles/datum_gateway/README.md new file mode 100644 index 0000000..cdf35e5 --- /dev/null +++ b/ansible/roles/datum_gateway/README.md @@ -0,0 +1,73 @@ +# `datum_gateway` + +Builds and runs [DATUM Gateway](https://github.com/OCEAN-xyz/datum_gateway), the +solo/pooled mining gateway, on `knots-box`. The calling playbook adds two more +plays on the edge host: the dashboard via `caddy_site`, and the public Stratum +port via `socket_proxy`. + +Converted from `deploy_datum_gateway_playbook.yml` (802 lines) under Plan 6. The +playbook is now 68 lines and keeps all three plays. + +## ⚠ This is half of a system + +The Bitcoin Knots node on the same host feeds this gateway through +`blocknotify=killall -USR1 datum_gateway` in `bitcoin.conf` — see +`roles/bitcoin_knots/README.md`, where that line was found to be missing from the +template entirely. **Changing either config means thinking about both.** + +Interrupting Stratum costs mining shares. Check before any run that restarts it: + +```bash +ss -tn state established '( sport = :23334 )' +``` + +## Two pieces of drift where the node was right + +The repo and the node had diverged on values that matter, and the deployment +would have applied the repo's: + +| | node (correct) | repo said | +|---|---|---| +| `datum_mining_address` | `bc1qvrj3g84…` | `bc1qdse9dsg…` | +| `pool_pass_workers` / `_full_users` | `false` | `true` | + +The address is the one that would have hurt: **it is where block rewards are +paid**, and unlike fulcrum and bitcoin-knots the `Restart datum-gateway` handler +here was *never* gated, so the change would have applied immediately rather than +sitting inert. Both corrected in the vault and defaults, with notes. + +Verify semantics rather than text when touching `config.json` — render it and +compare parsed JSON, because the live file is single-line and the template is +pretty-printed, so a textual diff is all noise: + +```python +json.load(open('live.json')) == json.load(open('rendered.json')) +``` + +## `config.json` holds real secrets — diff is suppressed + +The file carries `bitcoind.rpcpassword` and `api.admin_password`. `--diff` +prints rendered content, so the task sets `diff: false` by default; pass +`-e datum_reveal_config=true` to opt in. + +Note `pool_pass_workers` / `pool_pass_full_users` are **booleans**, not +passwords, despite the names — they control DATUM's pool-password passthrough. +`mining.pool_address` is a Bitcoin address and public by nature. + +## Expect `changed` on the compile every run + +`Configure cmake build` and `Compile datum_gateway` are bare `command:` tasks +with no `changed_when`, so they always report changed and always re-run. The +build is reproducible — `Install datum_gateway binary` sees identical content and +does not replace it, so the installed binary keeps its original timestamp — but +the compile itself is wasted work on every run. That is the idempotent floor, not +drift. + +## Monitoring: one variable, no product knowledge + +The check tests the gateway API and records the answer in its exit code, which +systemd keeps: `systemctl is-failed datum-gateway-healthcheck.service`. Set +`healthcheck_push_url` to report anywhere accepting an HTTP ping. + +Unlike the other services here, only the health-check *timer* handler was gated +by `uptime_kuma_enabled`; the main deployment restart worked throughout. diff --git a/ansible/services/datum-gateway/datum_gateway_vars.yml b/ansible/roles/datum_gateway/defaults/main.yml similarity index 57% rename from ansible/services/datum-gateway/datum_gateway_vars.yml rename to ansible/roles/datum_gateway/defaults/main.yml index 48bb5b7..d3647ec 100644 --- a/ansible/services/datum-gateway/datum_gateway_vars.yml +++ b/ansible/roles/datum_gateway/defaults/main.yml @@ -14,8 +14,8 @@ datum_gateway_log_dir: /var/log/datum-gateway datum_gateway_bin_path: /usr/local/bin/datum_gateway # Ports -datum_gateway_stratum_port: 23334 # Miners connect here via Stratum v1 -datum_gateway_api_port: 7152 # Web dashboard / API +datum_gateway_stratum_port: "{{ service_settings.datum_gateway.stratum_port }}" +datum_gateway_api_port: "{{ service_settings.datum_gateway.api_port }}" # Stratum settings datum_vardiff_min: 524288 # Minimum share difficulty (must be power of 2; OCEAN floor overrides if higher) @@ -37,7 +37,18 @@ datum_bitcoin_rpc_url: "http://127.0.0.1:8332" datum_coinbase_tag_primary: "DATUM" datum_coinbase_tag_secondary: "BY ORDER OF BIP110" -datum_pool_pass_workers: true -datum_pool_pass_full_users: true +# Both false on the node; the vars file said true. Corrected 2026-09-13 to +# match reality, on the same basis as datum_mining_address: the running node +# is authoritative. These control DATUM's pool-password passthrough. +datum_pool_pass_workers: false +datum_pool_pass_full_users: false datum_pooled_mining_only: true + +# --- Health check ----------------------------------------------------------- +# Checks the DATUM Gateway API and records the answer in its exit code, which +# systemd keeps: `systemctl is-failed datum-gateway-healthcheck.service`. +# +# WHERE TO REPORT HEALTH — the one place to plug in monitoring. Empty means +# check, exit honestly, report nowhere. +healthcheck_push_url: "" diff --git a/ansible/roles/datum_gateway/handlers/main.yml b/ansible/roles/datum_gateway/handlers/main.yml new file mode 100644 index 0000000..b7cfe25 --- /dev/null +++ b/ansible/roles/datum_gateway/handlers/main.yml @@ -0,0 +1,15 @@ +--- +- name: Restart datum-gateway + systemd: + name: datum-gateway + state: restarted + daemon_reload: yes + +# Ungated. This one carried `when: uptime_kuma_enabled | default(false)` while +# the main Restart datum-gateway handler above did not — so on this service the +# deployment restart worked and only the health-check timer restart was dead. +- name: Restart datum-gateway health check timer + systemd: + name: datum-gateway-healthcheck.timer + state: restarted + daemon_reload: yes diff --git a/ansible/roles/datum_gateway/tasks/configure.yml b/ansible/roles/datum_gateway/tasks/configure.yml new file mode 100644 index 0000000..463dec0 --- /dev/null +++ b/ansible/roles/datum_gateway/tasks/configure.yml @@ -0,0 +1,25 @@ +--- +# Ownership copied verbatim from the playbook this replaces and verified +# mechanically against `git show HEAD:`. +- name: Write DATUM Gateway config.json + ansible.builtin.template: + src: config.json.j2 + dest: "{{ datum_gateway_config_dir }}/config.json" + owner: "{{ datum_gateway_user }}" + group: "{{ datum_gateway_group }}" + mode: '0640' + # config.json carries the bitcoind RPC password, the API admin password and + # the pool passwords. `--diff` prints rendered content, so running with --diff + # put all of them on the terminal and into any log capturing it. Suppressed by + # default; pass -e datum_reveal_config=true when you genuinely need the diff. + diff: "{{ datum_reveal_config | default(false) | bool }}" + notify: Restart datum-gateway + +- name: Create datum-gateway systemd service + ansible.builtin.template: + src: datum-gateway.service.j2 + dest: /etc/systemd/system/datum-gateway.service + owner: root + group: root + mode: '0644' + notify: Restart datum-gateway diff --git a/ansible/roles/datum_gateway/tasks/healthcheck.yml b/ansible/roles/datum_gateway/tasks/healthcheck.yml new file mode 100644 index 0000000..211b85b --- /dev/null +++ b/ansible/roles/datum_gateway/tasks/healthcheck.yml @@ -0,0 +1,50 @@ +--- +# Everything here answers "is DATUM Gateway healthy" and records the answer. The +# Uptime Kuma specifics that used to follow — an embedded Python script creating +# monitors over the API, a /tmp credentials file, a push-URL file read back and +# parsed, and a systemd Environment= rewrite — are gone. Where it reports is now +# one variable, healthcheck_push_url. +- name: Create DATUM Gateway health check script + ansible.builtin.template: + src: healthcheck.sh.j2 + dest: /usr/local/bin/datum-gateway-healthcheck-push.sh + owner: root + group: root + mode: '0755' + validate: "bash -n %s" + +- name: Create datum-gateway health check systemd service + ansible.builtin.template: + src: healthcheck.service.j2 + dest: /etc/systemd/system/datum-gateway-healthcheck.service + owner: root + group: root + mode: '0644' + notify: Restart datum-gateway health check timer + +- name: Create datum-gateway health check systemd timer + ansible.builtin.template: + src: healthcheck.timer.j2 + dest: /etc/systemd/system/datum-gateway-healthcheck.timer + owner: root + group: root + mode: '0644' + notify: Restart datum-gateway health check timer + +- name: Reload systemd daemon after health check units + systemd: + daemon_reload: yes + +# Ungated: enabling a timer is deployment, not monitoring. +- name: Enable and restart the datum-gateway health check timer + systemd: + name: datum-gateway-healthcheck.timer + enabled: yes + state: restarted + daemon_reload: yes + +# Arms the timer and smoke-tests the check. See roles/bitcoin_knots/README.md for +# why restarting the timer alone is not enough with OnBootSec + OnUnitActiveSec. +- name: Run the DATUM Gateway health check once to arm the timer + command: systemctl start datum-gateway-healthcheck.service + changed_when: false diff --git a/ansible/roles/datum_gateway/tasks/install.yml b/ansible/roles/datum_gateway/tasks/install.yml new file mode 100644 index 0000000..61dcadb --- /dev/null +++ b/ansible/roles/datum_gateway/tasks/install.yml @@ -0,0 +1,74 @@ +--- +- name: Install DATUM Gateway build dependencies + apt: + name: + - cmake + - build-essential + - git + - libjansson-dev + - libmicrohttpd-dev + - libsodium-dev + - libcurl4-openssl-dev + # Runtime-only (netcat for health check) + - netcat-openbsd + state: present + update_cache: yes + +# =========================================== +# System User and Directories +# =========================================== +- name: Create datum system user + user: + name: "{{ datum_gateway_user }}" + system: yes + shell: /usr/sbin/nologin + home: "{{ datum_gateway_dir }}" + create_home: no + comment: "DATUM Gateway" + +- name: Create DATUM Gateway directories + file: + path: "{{ item.path }}" + state: directory + owner: "{{ item.owner }}" + group: "{{ datum_gateway_group }}" + mode: "{{ item.mode }}" + loop: + - { path: "{{ datum_gateway_dir }}", owner: root, mode: "0755" } + - { path: "{{ datum_gateway_source_dir }}", owner: root, mode: "0755" } + - { path: "{{ datum_gateway_config_dir }}", owner: "{{ datum_gateway_user }}", mode: "0750" } + - { path: "{{ datum_gateway_log_dir }}", owner: "{{ datum_gateway_user }}", mode: "0750" } + +# =========================================== +# Build from Source +# =========================================== +- name: Clone DATUM Gateway repository at {{ datum_gateway_version }} + git: + repo: https://github.com/OCEAN-xyz/datum_gateway.git + dest: "{{ datum_gateway_source_dir }}" + version: "{{ datum_gateway_version }}" + force: yes + register: git_clone + +- name: Configure cmake build + command: cmake . -DCMAKE_BUILD_TYPE=Release + args: + chdir: "{{ datum_gateway_source_dir }}" + +- name: Compile datum_gateway + command: make -j{{ datum_gateway_build_jobs }} + args: + chdir: "{{ datum_gateway_source_dir }}" + +- name: Install datum_gateway binary + copy: + src: "{{ datum_gateway_source_dir }}/datum_gateway" + dest: "{{ datum_gateway_bin_path }}" + remote_src: yes + owner: root + group: root + mode: "0755" + notify: Restart datum-gateway + +# =========================================== +# Configuration diff --git a/ansible/roles/datum_gateway/tasks/main.yml b/ansible/roles/datum_gateway/tasks/main.yml new file mode 100644 index 0000000..57d9a45 --- /dev/null +++ b/ansible/roles/datum_gateway/tasks/main.yml @@ -0,0 +1,6 @@ +--- +# import_tasks, not include_tasks: static imports stay visible to --list-tasks. +- ansible.builtin.import_tasks: install.yml +- ansible.builtin.import_tasks: configure.yml +- ansible.builtin.import_tasks: service.yml +- ansible.builtin.import_tasks: healthcheck.yml diff --git a/ansible/roles/datum_gateway/tasks/service.yml b/ansible/roles/datum_gateway/tasks/service.yml new file mode 100644 index 0000000..c8581fd --- /dev/null +++ b/ansible/roles/datum_gateway/tasks/service.yml @@ -0,0 +1,16 @@ +--- +- name: Reload systemd daemon + systemd: + daemon_reload: yes + +- name: Enable and start datum-gateway + systemd: + name: datum-gateway + enabled: yes + state: started + +# =========================================== +# Health Check Script + Systemd Timer +# =========================================== +# ═════════════════════════════════════════════════════════════════════════ +# DEPRECATED — Uptime Kuma was decommissioned on 2026-09-11. diff --git a/ansible/roles/datum_gateway/templates/config.json.j2 b/ansible/roles/datum_gateway/templates/config.json.j2 new file mode 100644 index 0000000..e17a386 --- /dev/null +++ b/ansible/roles/datum_gateway/templates/config.json.j2 @@ -0,0 +1,35 @@ +{ + "bitcoind": { + "rpcuser": "{{ bitcoin_rpc_user }}", + "rpcpassword": "{{ bitcoin_rpc_password }}", + "rpcurl": "{{ datum_bitcoin_rpc_url }}", + "notify_fallback": true + }, + "stratum": { + "listen_port": {{ datum_gateway_stratum_port }}, + "vardiff_min": {{ datum_vardiff_min }} + }, + "mining": { + "pool_address": "{{ datum_mining_address }}", + "coinbase_tag_primary": "{{ datum_coinbase_tag_primary }}", + "coinbase_tag_secondary": "{{ datum_coinbase_tag_secondary }}" + }, + "api": { + "admin_password": "{{ datum_gateway_admin_password }}", + "listen_port": {{ datum_gateway_api_port }}, + "modify_conf": false + }, + "logger": { + "log_to_console": true, + "log_to_file": true, + "log_file": "{{ datum_gateway_log_dir }}/datum_gateway.log", + "log_rotate_daily": true, + "log_level_console": 2, + "log_level_file": 1 + }, + "datum": { + "pool_pass_workers": {{ datum_pool_pass_workers | lower }}, + "pool_pass_full_users": {{ datum_pool_pass_full_users | lower }}, + "pooled_mining_only": {{ datum_pooled_mining_only | lower }} + } +} diff --git a/ansible/roles/datum_gateway/templates/datum-gateway.service.j2 b/ansible/roles/datum_gateway/templates/datum-gateway.service.j2 new file mode 100644 index 0000000..18f7a3c --- /dev/null +++ b/ansible/roles/datum_gateway/templates/datum-gateway.service.j2 @@ -0,0 +1,22 @@ +[Unit] +Description=DATUM Gateway - Bitcoin Mining Gateway +Documentation=https://github.com/OCEAN-xyz/datum_gateway +After=network.target bitcoind.service +Wants=bitcoind.service + +[Service] +User={{ datum_gateway_user }} +Group={{ datum_gateway_group }} +Type=simple +ExecStart={{ datum_gateway_bin_path }} --config {{ datum_gateway_config_dir }}/config.json +Restart=on-failure +RestartSec=10 +StandardOutput=journal +StandardError=journal + +# Prevent config from being read by other users +ReadWritePaths={{ datum_gateway_log_dir }} +ReadOnlyPaths={{ datum_gateway_config_dir }} + +[Install] +WantedBy=multi-user.target diff --git a/ansible/roles/datum_gateway/templates/healthcheck.service.j2 b/ansible/roles/datum_gateway/templates/healthcheck.service.j2 new file mode 100644 index 0000000..5dcd3f5 --- /dev/null +++ b/ansible/roles/datum_gateway/templates/healthcheck.service.j2 @@ -0,0 +1,14 @@ +[Unit] +Description=DATUM Gateway Health Check +After=network.target datum-gateway.service + +[Service] +Type=oneshot +User=root +ExecStart=/usr/local/bin/datum-gateway-healthcheck-push.sh +Environment=HEALTHCHECK_PUSH_URL={{ healthcheck_push_url }} +StandardOutput=journal +StandardError=journal + +[Install] +WantedBy=multi-user.target diff --git a/ansible/roles/datum_gateway/templates/healthcheck.sh.j2 b/ansible/roles/datum_gateway/templates/healthcheck.sh.j2 new file mode 100644 index 0000000..ba8d069 --- /dev/null +++ b/ansible/roles/datum_gateway/templates/healthcheck.sh.j2 @@ -0,0 +1,32 @@ +#!/bin/bash +# DATUM Gateway health check — managed by Ansible (roles/datum_gateway) +# +# The exit code is the answer and systemd keeps it: +# systemctl is-failed datum-gateway-healthcheck.service +# Reporting anywhere else is optional and generic. +PUSH_URL="${HEALTHCHECK_PUSH_URL:-}" +STRATUM_PORT={{ datum_gateway_stratum_port }} + +check_datum() { + # Service must be active and stratum port must be listening + systemctl is-active --quiet datum-gateway && \ + nc -z 127.0.0.1 "${STRATUM_PORT}" +} + +report() { + local status=$1 + local msg=$2 + # No push URL is normal, not an error: the exit code below is still a + # complete answer for anything reading unit state. + [ -n "$PUSH_URL" ] || return 0 + curl -s --max-time 10 --retry 2 -o /dev/null \ + "${PUSH_URL}?status=${status}&msg=${msg// /%20}&ping=" || true +} + +if check_datum; then + report "up" "OK" + exit 0 +else + report "down" "DATUM Gateway not responding" + exit 1 +fi diff --git a/ansible/roles/datum_gateway/templates/healthcheck.timer.j2 b/ansible/roles/datum_gateway/templates/healthcheck.timer.j2 new file mode 100644 index 0000000..c14d1d2 --- /dev/null +++ b/ansible/roles/datum_gateway/templates/healthcheck.timer.j2 @@ -0,0 +1,10 @@ +[Unit] +Description=DATUM Gateway Health Check Timer + +[Timer] +OnBootSec=2min +OnUnitActiveSec=1min +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/ansible/services/datum-gateway/deploy_datum_gateway_playbook.yml b/ansible/services/datum-gateway/deploy_datum_gateway_playbook.yml index 0c53e9d..371f3fa 100644 --- a/ansible/services/datum-gateway/deploy_datum_gateway_playbook.yml +++ b/ansible/services/datum-gateway/deploy_datum_gateway_playbook.yml @@ -1,667 +1,59 @@ --- -# DATUM Gateway Deployment Playbook +# DATUM Gateway: solo/pooled mining gateway, built from source on knots-box. # -# Deploys DATUM Gateway (https://github.com/OCEAN-xyz/datum_gateway) on the -# Bitcoin Knots host so it has direct localhost RPC access to bitcoind. -# -# What this does: -# 1. Installs build deps and compiles datum_gateway from source -# 2. Creates a dedicated system user and config/log directories -# 3. Writes /etc/datum-gateway/config.json from vars/secrets -# 4. Patches bitcoin.conf with the required blockmaxsize/blocknotify lines -# 5. Creates and enables a systemd service -# 6. Creates a push-monitor health check script + systemd timer -# 7. Registers a push monitor in Uptime Kuma -# -# Separate play: adds a Caddy reverse proxy on vipy for the dashboard. -# -# Stratum port (23334) is bound on knots_box_local. Expose it to miners via -# a firewall rule, Tailscale, or a socket proxy on vipy — not handled here. -# -# Required secrets in infra_secrets.yml: -# datum_mining_address - Bitcoin address for block rewards -# datum_gateway_admin_password - Password for the /api admin endpoint -# bitcoin_rpc_user - Shared with the bitcoin-knots deployment -# bitcoin_rpc_password - Shared with the bitcoin-knots deployment - -- name: Deploy DATUM Gateway on knots_box_local +# This is HALF OF A SYSTEM. The Bitcoin Knots node on the same host feeds it via +# `blocknotify=killall -USR1 datum_gateway` in bitcoin.conf (see +# roles/bitcoin_knots/README.md). Changing either config means thinking about +# both. Interrupting Stratum costs mining shares, so check for connected miners +# before restarting: +# ss -tn state established '( sport = :23334 )' +- name: Deploy DATUM Gateway on the bitcoin host hosts: bitcoin become: yes vars_files: - ../../infra_vars.yml - ../../services_config.yml - ../../infra_secrets.yml - - ./datum_gateway_vars.yml vars: - datum_gateway_subdomain: "{{ subdomains.datum_gateway }}" - datum_gateway_domain: "{{ datum_gateway_subdomain }}.{{ root_domain }}" - uptime_kuma_api_url: "https://{{ subdomains.uptime_kuma }}.{{ root_domain }}" + # Preserves the push URL this check reports to. The role knows nothing about + # Uptime Kuma — this is just "a URL that accepts a ping". + healthcheck_push_url: "{{ healthcheck_push_urls.datum_gateway | default('') }}" + roles: + - datum_gateway - tasks: - # =========================================== - # Build Dependencies - # =========================================== - - name: Install DATUM Gateway build dependencies - apt: - name: - - cmake - - build-essential - - git - - libjansson-dev - - libmicrohttpd-dev - - libsodium-dev - - libcurl4-openssl-dev - # Runtime-only (netcat for health check) - - netcat-openbsd - state: present - update_cache: yes - - # =========================================== - # System User and Directories - # =========================================== - - name: Create datum system user - user: - name: "{{ datum_gateway_user }}" - system: yes - shell: /usr/sbin/nologin - home: "{{ datum_gateway_dir }}" - create_home: no - comment: "DATUM Gateway" - - - name: Create DATUM Gateway directories - file: - path: "{{ item.path }}" - state: directory - owner: "{{ item.owner }}" - group: "{{ datum_gateway_group }}" - mode: "{{ item.mode }}" - loop: - - { path: "{{ datum_gateway_dir }}", owner: root, mode: "0755" } - - { path: "{{ datum_gateway_source_dir }}", owner: root, mode: "0755" } - - { path: "{{ datum_gateway_config_dir }}", owner: "{{ datum_gateway_user }}", mode: "0750" } - - { path: "{{ datum_gateway_log_dir }}", owner: "{{ datum_gateway_user }}", mode: "0750" } - - # =========================================== - # Build from Source - # =========================================== - - name: Clone DATUM Gateway repository at {{ datum_gateway_version }} - git: - repo: https://github.com/OCEAN-xyz/datum_gateway.git - dest: "{{ datum_gateway_source_dir }}" - version: "{{ datum_gateway_version }}" - force: yes - register: git_clone - - - name: Configure cmake build - command: cmake . -DCMAKE_BUILD_TYPE=Release - args: - chdir: "{{ datum_gateway_source_dir }}" - - - name: Compile datum_gateway - command: make -j{{ datum_gateway_build_jobs }} - args: - chdir: "{{ datum_gateway_source_dir }}" - - - name: Install datum_gateway binary - copy: - src: "{{ datum_gateway_source_dir }}/datum_gateway" - dest: "{{ datum_gateway_bin_path }}" - remote_src: yes - owner: root - group: root - mode: "0755" - notify: Restart datum-gateway - - # =========================================== - # Configuration - # =========================================== - - name: Write DATUM Gateway config.json - copy: - dest: "{{ datum_gateway_config_dir }}/config.json" - content: | - { - "bitcoind": { - "rpcuser": "{{ bitcoin_rpc_user }}", - "rpcpassword": "{{ bitcoin_rpc_password }}", - "rpcurl": "{{ datum_bitcoin_rpc_url }}", - "notify_fallback": true - }, - "stratum": { - "listen_port": {{ datum_gateway_stratum_port }}, - "vardiff_min": {{ datum_vardiff_min }} - }, - "mining": { - "pool_address": "{{ datum_mining_address }}", - "coinbase_tag_primary": "{{ datum_coinbase_tag_primary }}", - "coinbase_tag_secondary": "{{ datum_coinbase_tag_secondary }}" - }, - "api": { - "admin_password": "{{ datum_gateway_admin_password }}", - "listen_port": {{ datum_gateway_api_port }}, - "modify_conf": false - }, - "logger": { - "log_to_console": true, - "log_to_file": true, - "log_file": "{{ datum_gateway_log_dir }}/datum_gateway.log", - "log_rotate_daily": true, - "log_level_console": 2, - "log_level_file": 1 - }, - "datum": { - "pool_pass_workers": {{ datum_pool_pass_workers | lower }}, - "pool_pass_full_users": {{ datum_pool_pass_full_users | lower }}, - "pooled_mining_only": {{ datum_pooled_mining_only | lower }} - } - } - owner: "{{ datum_gateway_user }}" - group: "{{ datum_gateway_group }}" - mode: "0640" - notify: Restart datum-gateway - - # =========================================== - # Systemd Service - # =========================================== - - name: Create datum-gateway systemd service - copy: - dest: /etc/systemd/system/datum-gateway.service - content: | - [Unit] - Description=DATUM Gateway - Bitcoin Mining Gateway - Documentation=https://github.com/OCEAN-xyz/datum_gateway - After=network.target bitcoind.service - Wants=bitcoind.service - - [Service] - User={{ datum_gateway_user }} - Group={{ datum_gateway_group }} - Type=simple - ExecStart={{ datum_gateway_bin_path }} --config {{ datum_gateway_config_dir }}/config.json - Restart=on-failure - RestartSec=10 - StandardOutput=journal - StandardError=journal - - # Prevent config from being read by other users - ReadWritePaths={{ datum_gateway_log_dir }} - ReadOnlyPaths={{ datum_gateway_config_dir }} - - [Install] - WantedBy=multi-user.target - owner: root - group: root - mode: "0644" - notify: Restart datum-gateway - - - name: Reload systemd daemon - systemd: - daemon_reload: yes - - - name: Enable and start datum-gateway - systemd: - name: datum-gateway - enabled: yes - state: started - - # =========================================== - # Health Check Script + Systemd Timer - # =========================================== - # ═════════════════════════════════════════════════════════════════════════ - # DEPRECATED — Uptime Kuma was decommissioned on 2026-09-11. - # - # Every task below is inert: uptime_kuma_enabled is false in - # group_vars/all/main.yml, so they all skip and the deployment above still - # runs normally. Kept because the health-check logic is the durable part — - # when a replacement exists, rewire the push transport and flip the flag. - # - # What was being monitored: archive/uptime_kuma/MONITORS.md - # ═════════════════════════════════════════════════════════════════════════ - - name: Create DATUM Gateway health check script - when: uptime_kuma_enabled | default(false) - copy: - dest: /usr/local/bin/datum-gateway-healthcheck-push.sh - content: | - #!/bin/bash - UPTIME_KUMA_PUSH_URL="${UPTIME_KUMA_PUSH_URL}" - STRATUM_PORT={{ datum_gateway_stratum_port }} - - check_datum() { - # Service must be active and stratum port must be listening - systemctl is-active --quiet datum-gateway && \ - nc -z 127.0.0.1 "${STRATUM_PORT}" - } - - push_to_uptime_kuma() { - local status=$1 - local msg=$2 - if [ -z "$UPTIME_KUMA_PUSH_URL" ]; then - echo "ERROR: UPTIME_KUMA_PUSH_URL not set" - return 1 - fi - curl -s --max-time 10 --retry 2 -o /dev/null \ - "${UPTIME_KUMA_PUSH_URL}?status=${status}&msg=${msg// /%20}&ping=" || true - } - - if check_datum; then - push_to_uptime_kuma "up" "OK" - exit 0 - else - push_to_uptime_kuma "down" "DATUM Gateway not responding" - exit 1 - fi - owner: root - group: root - mode: "0755" - - - name: Create datum-gateway health check systemd service - copy: - dest: /etc/systemd/system/datum-gateway-healthcheck.service - content: | - [Unit] - Description=DATUM Gateway Health Check - After=network.target datum-gateway.service - - [Service] - Type=oneshot - User=root - ExecStart=/usr/local/bin/datum-gateway-healthcheck-push.sh - Environment=UPTIME_KUMA_PUSH_URL= - StandardOutput=journal - StandardError=journal - - [Install] - WantedBy=multi-user.target - owner: root - group: root - mode: "0644" - - - name: Create datum-gateway health check systemd timer - copy: - dest: /etc/systemd/system/datum-gateway-healthcheck.timer - content: | - [Unit] - Description=DATUM Gateway Health Check Timer - - [Timer] - OnBootSec=2min - OnUnitActiveSec=1min - Persistent=true - - [Install] - WantedBy=timers.target - owner: root - group: root - mode: "0644" - - - name: Reload systemd daemon after health check units - systemd: - daemon_reload: yes - - - name: Enable and start datum-gateway health check timer - when: uptime_kuma_enabled | default(false) - systemd: - name: datum-gateway-healthcheck.timer - enabled: yes - state: started - - # =========================================== - # Uptime Kuma Push Monitor Setup - # =========================================== - - name: Create Uptime Kuma push monitor setup script for DATUM Gateway - when: uptime_kuma_enabled | default(false) - delegate_to: localhost - become: no - copy: - dest: /tmp/setup_datum_gateway_monitor.py - content: | - #!/usr/bin/env python3 - import sys - import time - import traceback - import yaml - - try: - import socketio.exceptions - except ImportError: - pass - - from uptime_kuma_api import UptimeKumaApi, MonitorType - - try: - with open('/tmp/ansible_datum_gateway_config.yml', 'r') as f: - config = yaml.safe_load(f) - - url = config['uptime_kuma_url'] - username = config['username'] - password = config['password'] - monitor_name = config['monitor_name'] - - api = UptimeKumaApi(url, timeout=30) - api.login(username, password) - - monitors = api.get_monitors() - - # Find or create "services" group - group = next((m for m in monitors if m.get('name') == 'services' and m.get('type') == 'group'), None) - if not group: - try: - api.add_monitor(type='group', name='services') - except Exception: - time.sleep(2) - monitors = api.get_monitors() - group = next((m for m in monitors if m.get('name') == 'services' and m.get('type') == 'group'), None) - - # Get ntfy notification ID - notifications = api.get_notifications() - ntfy_notification_id = None - for notif in notifications: - if notif.get('type') == 'ntfy': - ntfy_notification_id = notif.get('id') - break - - # Check if monitor already exists - existing = next((m for m in monitors if m.get('name') == monitor_name), None) - - push_url = None - - if existing: - print(f"Monitor '{monitor_name}' already exists (ID: {existing['id']})") - push_token = existing.get('pushToken') or existing.get('push_token') - if push_token: - push_url = f"{url}/api/push/{push_token}" - else: - print(f"Creating push monitor '{monitor_name}'...") - try: - api.add_monitor( - type=MonitorType.PUSH, - name=monitor_name, - parent=group['id'], - interval=90, - maxretries=3, - retryInterval=60, - notificationIDList={ntfy_notification_id: True} if ntfy_notification_id else {} - ) - except Exception as e: - # socketio timeout: add_monitor may have succeeded server-side - print(f"add_monitor raised (possibly timeout): {e}", file=sys.stderr) - time.sleep(2) - - monitors = api.get_monitors() - new_monitor = next((m for m in monitors if m.get('name') == monitor_name), None) - if new_monitor: - push_token = new_monitor.get('pushToken') or new_monitor.get('push_token') - if push_token: - push_url = f"{url}/api/push/{push_token}" - - api.disconnect() - - if push_url: - print(f"PUSH_URL={push_url}") - with open('/tmp/datum_gateway_push_url.txt', 'w') as f: - f.write(push_url) - - print("SUCCESS") - - except Exception as e: - print(f"ERROR: {str(e)}", file=sys.stderr) - traceback.print_exc(file=sys.stderr) - sys.exit(1) - mode: "0755" - - - name: Create temporary config for push monitor setup - when: uptime_kuma_enabled | default(false) - delegate_to: localhost - become: no - copy: - dest: /tmp/ansible_datum_gateway_config.yml - content: | - uptime_kuma_url: "{{ uptime_kuma_api_url }}" - username: "{{ uptime_kuma_username }}" - password: "{{ uptime_kuma_password }}" - monitor_name: "DATUM Gateway" - mode: "0644" - - - name: Run Uptime Kuma push monitor setup - when: uptime_kuma_enabled | default(false) - command: python3 /tmp/setup_datum_gateway_monitor.py - delegate_to: localhost - become: no - register: monitor_setup - changed_when: "'SUCCESS' in monitor_setup.stdout" - ignore_errors: yes - - - name: Display monitor setup output - debug: - msg: "{{ monitor_setup.stdout_lines }}" - when: monitor_setup.stdout is defined - - - name: Read push URL from file - when: uptime_kuma_enabled | default(false) - slurp: - src: /tmp/datum_gateway_push_url.txt - delegate_to: localhost - become: no - register: push_url_file - ignore_errors: yes - - - name: Parse push URL - set_fact: - datum_push_url: "{{ push_url_file.content | b64decode | trim }}" - when: push_url_file.content is defined - - - name: Update health check service with push URL - lineinfile: - path: /etc/systemd/system/datum-gateway-healthcheck.service - regexp: "^Environment=UPTIME_KUMA_PUSH_URL=" - line: "Environment=UPTIME_KUMA_PUSH_URL={{ datum_push_url }}" - when: datum_push_url is defined - notify: Restart datum-gateway health check timer - - - name: Clean up temporary files - when: uptime_kuma_enabled | default(false) - delegate_to: localhost - become: no - file: - path: "{{ item }}" - state: absent - loop: - - /tmp/setup_datum_gateway_monitor.py - - /tmp/ansible_datum_gateway_config.yml - - /tmp/datum_gateway_push_url.txt - - handlers: - - name: Restart datum-gateway - systemd: - name: datum-gateway - state: restarted - daemon_reload: yes - - - name: Restart datum-gateway health check timer - when: uptime_kuma_enabled | default(false) - systemd: - name: datum-gateway-healthcheck.timer - state: restarted - daemon_reload: yes - - -# =========================================== -# Caddy Reverse Proxy for DATUM Dashboard (on vipy) -# =========================================== -- name: Configure Caddy reverse proxy for DATUM Gateway dashboard on the edge host +- name: Configure Caddy reverse proxy for the DATUM Gateway dashboard on the edge host hosts: edge become: yes vars_files: - ../../infra_vars.yml - ../../services_config.yml - ../../infra_secrets.yml - - ./datum_gateway_vars.yml - vars: - datum_gateway_subdomain: "{{ subdomains.datum_gateway }}" - datum_gateway_domain: "{{ datum_gateway_subdomain }}.{{ root_domain }}" - uptime_kuma_api_url: "https://{{ subdomains.uptime_kuma }}.{{ root_domain }}" - tasks: - name: Publish the DATUM Gateway dashboard through Caddy ansible.builtin.include_role: name: caddy_site vars: caddy_site_name: datum-gateway - caddy_site_domain: "{{ datum_gateway_domain }}" - caddy_site_upstream: "knots-box:{{ datum_gateway_api_port }}" + caddy_site_domain: "{{ subdomains.datum_gateway }}.{{ root_domain }}" + caddy_site_upstream: "{{ service_settings.datum_gateway.tailscale_hostname }}:{{ service_settings.datum_gateway.api_port }}" caddy_site_resolvers: "100.100.100.100" caddy_site_basic_auth: - user: "{{ datum_dashboard_username }}" hash: "{{ datum_dashboard_password_hash }}" - # The role validates the site fragment on its own. This re-validates the - # whole assembled Caddyfile, which is the only thing that catches a - # conflict between this site and another. Kept from the hand-rolled - # version; the other nine services never had it. + # The role validates its own site fragment; this re-validates the whole + # assembled Caddyfile, which is the only thing that catches a conflict + # between two sites. - name: Validate the assembled Caddyfile ansible.builtin.command: caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile changed_when: false - - name: Display DATUM Gateway dashboard URL - when: uptime_kuma_enabled | default(false) - debug: - msg: "DATUM Gateway dashboard: https://{{ datum_gateway_domain }}" - - # =========================================== - # Uptime Kuma HTTP Monitor for Public Dashboard - # =========================================== - - name: Create Uptime Kuma HTTP monitor setup script for DATUM dashboard - when: uptime_kuma_enabled | default(false) - delegate_to: localhost - become: no - copy: - dest: /tmp/setup_datum_http_monitor.py - content: | - #!/usr/bin/env python3 - import sys - import time - import traceback - import yaml - - from uptime_kuma_api import UptimeKumaApi, MonitorType - - try: - with open('/tmp/ansible_datum_http_config.yml', 'r') as f: - config = yaml.safe_load(f) - - url = config['uptime_kuma_url'] - username = config['username'] - password = config['password'] - monitor_url = config['monitor_url'] - monitor_name = config['monitor_name'] - - api = UptimeKumaApi(url, timeout=30) - api.login(username, password) - - monitors = api.get_monitors() - - group = next((m for m in monitors if m.get('name') == 'services' and m.get('type') == 'group'), None) - if not group: - try: - api.add_monitor(type='group', name='services') - except Exception: - time.sleep(2) - monitors = api.get_monitors() - group = next((m for m in monitors if m.get('name') == 'services' and m.get('type') == 'group'), None) - - notifications = api.get_notifications() - ntfy_notification_id = None - for notif in notifications: - if notif.get('type') == 'ntfy': - ntfy_notification_id = notif.get('id') - break - - existing = next((m for m in monitors if m.get('name') == monitor_name), None) - - if existing: - print(f"Monitor '{monitor_name}' already exists (ID: {existing['id']})") - else: - print(f"Creating HTTP monitor '{monitor_name}'...") - try: - api.add_monitor( - type=MonitorType.HTTP, - name=monitor_name, - url=monitor_url, - parent=group['id'], - interval=60, - maxretries=3, - retryInterval=60, - notificationIDList={ntfy_notification_id: True} if ntfy_notification_id else {} - ) - except Exception as e: - print(f"add_monitor raised (possibly timeout): {e}", file=sys.stderr) - time.sleep(2) - - api.disconnect() - print("SUCCESS") - - except Exception as e: - print(f"ERROR: {str(e)}", file=sys.stderr) - traceback.print_exc(file=sys.stderr) - sys.exit(1) - mode: "0755" - - - name: Create temporary config for HTTP monitor - when: uptime_kuma_enabled | default(false) - delegate_to: localhost - become: no - copy: - dest: /tmp/ansible_datum_http_config.yml - content: | - uptime_kuma_url: "{{ uptime_kuma_api_url }}" - username: "{{ uptime_kuma_username }}" - password: "{{ uptime_kuma_password }}" - monitor_url: "https://{{ datum_gateway_domain }}" - monitor_name: "DATUM Gateway Dashboard" - mode: "0644" - - - name: Run Uptime Kuma HTTP monitor setup - when: uptime_kuma_enabled | default(false) - command: python3 /tmp/setup_datum_http_monitor.py - delegate_to: localhost - become: no - register: http_monitor_setup - changed_when: "'SUCCESS' in http_monitor_setup.stdout" - ignore_errors: yes - - - name: Display HTTP monitor setup output - debug: - msg: "{{ http_monitor_setup.stdout_lines }}" - when: http_monitor_setup.stdout is defined - - - name: Clean up HTTP monitor temporary files - when: uptime_kuma_enabled | default(false) - delegate_to: localhost - become: no - file: - path: "{{ item }}" - state: absent - loop: - - /tmp/setup_datum_http_monitor.py - - /tmp/ansible_datum_http_config.yml - - -# =========================================== -# Stratum Port Forwarding on vipy via systemd-socket-proxyd -# Miners connect to vipy:23334; traffic is forwarded to knots-box:23334 -# over the Tailscale network, matching the Bitcoin P2P proxy pattern. -# =========================================== - name: Setup public Stratum port forwarding on the edge host hosts: edge become: yes vars_files: - ../../infra_vars.yml - ../../services_config.yml - - ../../infra_secrets.yml - - ./datum_gateway_vars.yml - vars: - datum_tailscale_hostname: "knots-box" - uptime_kuma_api_url: "https://{{ subdomains.uptime_kuma }}.{{ root_domain }}" - tasks: - name: Expose the DATUM Stratum port through a socket proxy ansible.builtin.include_role: @@ -669,134 +61,8 @@ vars: socket_proxy_name: datum-stratum socket_proxy_description: "DATUM Stratum" - socket_proxy_listen_port: "{{ datum_gateway_stratum_port }}" - socket_proxy_upstream_host: "{{ datum_tailscale_hostname }}" - # Matches the UFW comment already on vipy; the derived default would - # have said "DATUM Stratum" and rewritten the rule. + socket_proxy_listen_port: "{{ service_settings.datum_gateway.stratum_port }}" + socket_proxy_upstream_host: "{{ service_settings.datum_gateway.tailscale_hostname }}" + # Matches the UFW comment already on the edge host; the derived default + # would say "DATUM Stratum" and rewrite the rule. socket_proxy_ufw_comment: "DATUM Gateway Stratum public access" - - - name: Display public Stratum endpoint - when: uptime_kuma_enabled | default(false) - debug: - msg: "DATUM Stratum public endpoint: {{ ansible_host }}:{{ datum_gateway_stratum_port }}" - - # =========================================== - # Uptime Kuma TCP Monitor for Public Stratum - # =========================================== - - name: Create Uptime Kuma TCP monitor setup script for Stratum - when: uptime_kuma_enabled | default(false) - delegate_to: localhost - become: no - copy: - dest: /tmp/setup_datum_stratum_tcp_monitor.py - content: | - #!/usr/bin/env python3 - import sys - import time - import traceback - import yaml - from uptime_kuma_api import UptimeKumaApi, MonitorType - - try: - with open('/tmp/ansible_datum_stratum_config.yml', 'r') as f: - config = yaml.safe_load(f) - - url = config['uptime_kuma_url'] - username = config['username'] - password = config['password'] - monitor_host = config['monitor_host'] - monitor_port = config['monitor_port'] - monitor_name = config['monitor_name'] - - api = UptimeKumaApi(url, timeout=30) - api.login(username, password) - - monitors = api.get_monitors() - - group = next((m for m in monitors if m.get('name') == 'services' and m.get('type') == 'group'), None) - if not group: - try: - api.add_monitor(type='group', name='services') - except Exception: - time.sleep(2) - monitors = api.get_monitors() - group = next((m for m in monitors if m.get('name') == 'services' and m.get('type') == 'group'), None) - - notifications = api.get_notifications() - ntfy_notification_id = None - for notif in notifications: - if notif.get('type') == 'ntfy': - ntfy_notification_id = notif.get('id') - break - - existing = next((m for m in monitors if m.get('name') == monitor_name), None) - - if existing: - print(f"Monitor '{monitor_name}' already exists (ID: {existing['id']})") - else: - print(f"Creating TCP monitor '{monitor_name}'...") - try: - api.add_monitor( - type=MonitorType.PORT, - name=monitor_name, - hostname=monitor_host, - port=monitor_port, - parent=group['id'], - interval=60, - maxretries=3, - retryInterval=60, - notificationIDList={ntfy_notification_id: True} if ntfy_notification_id else {} - ) - except Exception as e: - print(f"add_monitor raised (possibly timeout): {e}", file=sys.stderr) - time.sleep(2) - - api.disconnect() - print("SUCCESS") - - except Exception as e: - print(f"ERROR: {str(e)}", file=sys.stderr) - traceback.print_exc(file=sys.stderr) - sys.exit(1) - mode: "0755" - - - name: Create temporary config for Stratum TCP monitor - when: uptime_kuma_enabled | default(false) - delegate_to: localhost - become: no - copy: - dest: /tmp/ansible_datum_stratum_config.yml - content: | - uptime_kuma_url: "{{ uptime_kuma_api_url }}" - username: "{{ uptime_kuma_username }}" - password: "{{ uptime_kuma_password }}" - monitor_host: "{{ ansible_host }}" - monitor_port: {{ datum_gateway_stratum_port }} - monitor_name: "DATUM Stratum (public)" - mode: "0644" - - - name: Run Uptime Kuma TCP monitor setup - when: uptime_kuma_enabled | default(false) - command: python3 /tmp/setup_datum_stratum_tcp_monitor.py - delegate_to: localhost - become: no - register: tcp_monitor_setup - changed_when: "'SUCCESS' in tcp_monitor_setup.stdout" - ignore_errors: yes - - - name: Display TCP monitor setup output - debug: - msg: "{{ tcp_monitor_setup.stdout_lines }}" - when: tcp_monitor_setup.stdout is defined - - - name: Clean up Stratum TCP monitor temporary files - when: uptime_kuma_enabled | default(false) - delegate_to: localhost - become: no - file: - path: "{{ item }}" - state: absent - loop: - - /tmp/setup_datum_stratum_tcp_monitor.py - - /tmp/ansible_datum_stratum_config.yml - diff --git a/ansible/services_config.yml b/ansible/services_config.yml index e342a79..a6dc9c6 100644 --- a/ansible/services_config.yml +++ b/ansible/services_config.yml @@ -52,6 +52,13 @@ service_settings: # edge host. A role default cannot reach that second play. p2p_port: 8333 tailscale_hostname: knots-box + datum_gateway: + # Needed on two hosts: the datum_gateway role deploys on knots-box, while the + # Caddy play (dashboard) and the socket-proxy play (Stratum) both run on the + # edge host. A role default cannot reach either of those plays. + api_port: 7152 + stratum_port: 23334 + tailscale_hostname: knots-box fulcrum: # Same shape as mempool: the fulcrum role deploys on fulcrum-box, and the # socket-proxy play publishes the SSL port from the edge host. A role default