diff --git a/README.md b/README.md index cd1cb1b..528869e 100644 --- a/README.md +++ b/README.md @@ -13,57 +13,79 @@ As the login is done via ssh make sure that the ssh key is registered at your id That way Ansible will be able to automatically detect the right ssh key and connect to the server. ## hosts -If you want to deploy to a new gateway you need to add it to the `hosts` file in the repo, just compare it to brunsbach and add your own details. +If you want to deploy to a new gateway you need to add it to the `hosts.yml` file in the repo, just compare it to brunsbach and add your own details. + +If you set enable_wireguard_exit to true ansible will deploy wireguard and attempt to generate a mullvad config. + +## Mullvad +This ansible script uses [wg-conf-gen](https://github.com/ffsh/wg-conf-gen) to generate a Mullvad wireguard configurration. + +The python script will call the Mullvad API with the details you provide in host_vars (see below). + +It will select a random gateway based on country and city. ### host_vars/$gatewayname.yml You also need to supply your fastd secret as an encrypted secret, you get the password via the NOC Team. To create a new fastd secret, execute the following, this will ask you for a password and open an editor. -``` +```bash ansible-vault create --vault-id fastd_key@prompt host_vars/$gatewayname.yml ``` -Enter -``` -fastd_secret: $yourkey -# If you want to use a wireguard exit -wireguard_interface: |- - [Interface] - ... -wireguard_peer: | - [Peer] - ... + +The config has the following options. + +| option | comment | +|:-------------|:-----------------------------------------------------------------------------| +| fastd_secret | fastd secret key | +| wg_device | Optional but you can put the name here that was generated by mullvad | +| wg_pk | Wireguard private key provided by mullvad | +| wg_address | ipV4 and ipV6 address provided by mullvad | +| wg_country | Country supported by mullvad | +| wg_city | A City that mullvad has in your selected country | +| ffshmon_mail | The email that should be used to send alerts if the wireguard tunnel is down | +| ffshmon_pw | The password for the email | + +For available country and city check here: https://mullvad.net/de/servers + +Example config: + +```yaml +fastd_secret: 1234df132fssd... +wg_device: Mellow Pony +wg_pk: aDfkfdsgnn1232345... +wg_address: 1.2.3.4/32,fxx...../128 +wg_country: Netherlands +wg_city: Amsterdam ffshmon_mail: wg-mon@freifunk-suedholstein.de -# Check KeePass -ffshmon_pw: ... +ffshmon_pw: secretpassword ``` save and close the editor, done you added your secret :) You can change the content any time by -``` +```bash ansible-vault edit --vault-id fastd_key@prompt host_vars/$gatewayname.yml ``` - ## Usage Run playbook on all gateways listed in `hosts`: -``` +```bash ansible-playbook --vault-id=fastd_key@prompt setup.yml ``` Run playbook on one host -``` +```bash ansible-playbook --vault-id=fastd_key@prompt setup.yml --limit $hostname ``` Run only the roles with the specific tag, to see which role is attached to which tag open `setup.yaml`: -``` +```bash ansible-playbook --vault-id=fastd_key@prompt setup.yml --tags "ssh keys" ``` These can also be combined: -``` +```bash ansible-playbook --vault-id=fastd_key@prompt setup.yml --limit $hostname --tags "oh-my-zsh" ``` \ No newline at end of file diff --git a/host_vars/barnitz.yml b/host_vars/barnitz.yml index a54ff28..6139f28 100644 --- a/host_vars/barnitz.yml +++ b/host_vars/barnitz.yml @@ -1,30 +1,22 @@ $ANSIBLE_VAULT;1.2;AES256;fastd_key -31636363336361613566666436383339666237316662366637313866643938333862616332393237 -6530626264633232393437623839316263626630646138620a323663653433616135653665373633 -33383738613031383664363564656464393436626537666630613761346464376538386561643731 -3963643339633361320a636436643463336636366363353533333662336236633433393835656131 -34313439323939353366336438343263303734633138393263636465383131306134626638393837 -63653130396232656261313936666538663262346237653839303166323438343937363461366632 -61393961613438306566616436643565323030306536363132383937303563326531326263646463 -65386236323539326331353937333035663737393031613661323062356434373333666263393633 -39393432353862626138373134316662643231316265323635613735353035306131363034356465 -39303066393033393433666338613236643563616338636461626235626138613535623733373933 -32303336633366363664343438643237363935616661373038303065363235643063353661303637 -63343261323833653865653137623330653139323137333030326263343232363034653731613230 -38656234663532396364316532393737366235636236636463643863643965303861636135643938 -36666538396239653031353732623666386637323432346264656233306237353261326337373236 -66326634626537616431323866323266613261623533636130633339373039333238623462326133 -30316138303936666163373631616439303165616434333334623461393832636366383862366638 -35353736646265386561633961346437383737616661333165343335386631633238353763336663 -64363663633838356135306335613237383733313962313936343066616334393530643233363432 -66663565383637643562373139303633373930353133346637343165313838336363323039396632 -32643265653535386537376263383165643864346366643665383164616632326339666535666362 -35663837656462303866643939373862633635323731376630633032323539323465326530353030 -39373264623232636639666562313738376335393635383036366665356436313164653364623832 -62373765393835393438383038653836356433343838343935363061343631303161323265666665 -65396331363366303266306636313333636138656534633765393632396366333466316464396263 -63396236636163383638323064333866666531346662626536313231343638383363623333663762 -35326433356564663666666235646564633933643036646531313335666236353465376439383134 -37326365396464363330333263353735353862646130303332653133393365643730313133353037 -35326530313637663131326332333536393732383538383233623638646261313938353937383961 -6365 +30353165366633313837613634396638336534353663626566626536623931336236303662646439 +6335623633623064393034303336336566366234623039360a316136323963383862656431653534 +64623431383731313062633561326637393535316139616537313963633836623466383735326635 +6263303634393430340a656262363665303564663963343837633031373765646666316265326232 +35303265653635663834393038626334616565633636646436363233656631373932643764383761 +35313739666662316333626433653462333934613635316136346261663161303161303832326633 +64656463633439376331656130393932626364353664383736323333306162323335303062623738 +62366231383662316663616662623764653336313737396263643833663431663239616432633565 +66653239346638396464666161393436303964653465343334316131633939366463633764613237 +64323163323332396437316234353735323232626238353336386131343335366630383862366139 +62383037343864613338383039396237343439646336386164316137646539643834663836303637 +32646235346562306331303263346534333965643662663561343763653636356531626263323330 +33616531336538303539666530663932646463343238376564303430633137343431623632653238 +61653163623130653063386538353431643063383062623237623433326435363835636633326333 +66333731663866353238323234623135643065306365393839303338363663393930396231356564 +64366231336563643662383164303933623933613731326366356339306230643033343564376563 +35643036323036313338396131393437393063613234313363393062316163316463356437326665 +63396339303032303435376661626661643337633038653461333563343261393065333163646632 +33396530313031643435653261333039386566323235623664653838376232623763396462306331 +34316366636564303732373532386232633362396337323862623762333732323639333631353532 +3061 diff --git a/host_vars/beste.yml b/host_vars/beste.yml index 5723922..ea35b71 100644 --- a/host_vars/beste.yml +++ b/host_vars/beste.yml @@ -1,30 +1,22 @@ $ANSIBLE_VAULT;1.2;AES256;fastd_key -62646264366537343736363033373239373961316138343265313836313738626539343238326534 -3634376262376435366139396536623632383834373233340a336431356261623966313665626230 -61343762373866633761336566663462353437353363383461353136653466383863383433336338 -3232666562636534300a376633636632346532616635306435333763373064636636663937343961 -36363963633635353632376162393733346563306139383832666436646232653030646130633064 -38336436626632353165306162323730643631306662393633373066343561396661386534633362 -31383665643063326236643935616133323432656362653664643062363238643063393630636463 -65376164346561636663396163373165613239366230343565656232323038356663386666303332 -33333031356333323137663433383535396663383632666230333763313264323034316633316262 -34336461343338383636336330313461653963616565333061636262376161383335316533643066 -39356663626435326335363134616132396433303437386464666235316163643565623133376566 -65363063643962336166363633636137643663336365663838313538353039336230363465343431 -37643561396265653531613032663033613337343731386136343939343537363339363964613035 -36376131323166626365353536623162396665323230333764306438383436343534633961613631 -36373138306638616365303530653032336263636136366165663430376437633765343566316432 -39636639306633613432636464326161653636306664323338333562643530653538326433353038 -63343835326665663139393239346530336361343734373534616164343938323364383539636530 -63306666343431633533356564663239663837303432616663626463653731656433643130636165 -39623733386537376232343737303131663163616630303466613333323130346361343463393563 -61646239363530326565643137353261613935313333323838353561636635323962613430656531 -65316239643464616237346165393536653961646463663937663962346165393339366339393030 -37653430346439633063386465653263343833366134616266343933663364623564303438633362 -33303462333130323166376639303631333766366332346435306331386636333134306462346532 -66366333373039396536616261666339343566353765623738626530323537616133383464363230 -34386536366334356634376138656130333339376632333762353461363730316362613034346338 -33386637613530653464636433383666363530663439343666386566383339343935613162363761 -36633365353534636364313162633635366566346565626639333033303765366661656161356663 -39666533323030393736353664616432303066343330613933343562616239396461653965636430 -37323033663466386161663639616530376465626561333265626462663266383034 +62623333663332646538666139616464333839373239623132366531333831666366306564313432 +6132623336336462303532393064353763313934383566380a313732613130653838613966356534 +36393535306566326539333231366238316338393039353164343337366535636539633466373563 +3762303832613138370a633062336535383638373362326264323838623166333861343065333231 +64343231306539653366396536313766653962616462653064646663636439613334343563636239 +35653539323233303339623030613061663136373032313031373833356431643730396662646138 +63376331363531373534623264393636646261623661326230616465396164343032613762393164 +33373861393134303237393839383837343634383561666537623062396664616163346636656233 +32383634393230386437356539643137393037313638626466373333303833623264333561353362 +39383232336530373137613432333330623230633931376461343062333566373738646133636339 +35663064636131633262303736393035633664646464373065343739356361373561383933333263 +64623238313535303632383930363239663161653139623164346338353035313665326231646565 +37346139353733633262663461656165343361386335366665616536623266366236643635333764 +33376165373935646138333731386165376234306464323835376664633438656166636263343433 +32336238663261376337663637316232623631363036323938386235643862663862303531376563 +38383434663632656634656166363565363031633636393931653265343832623137333230366637 +37613237656432643631366562313462383335333236376537313363376265333136333632653666 +64633137643038313035333865656135386136303366393164306637303734313539323461383637 +38336161633863366336316666616234373066333065653061363161326165346137636535663664 +64646533306431623964303736653331633230636661623136646237323136663866623666303463 +30376563613962613135626461343835393138386337333130303131363663323366 diff --git a/host_vars/bille.yml b/host_vars/bille.yml index fbf26ba..f678d21 100644 --- a/host_vars/bille.yml +++ b/host_vars/bille.yml @@ -1,30 +1,22 @@ $ANSIBLE_VAULT;1.2;AES256;fastd_key -37346636306463633933323336353338366330303164363130346633316162643831353565623432 -3166353935323332633661313262343530323066323735660a303734653264363233353533303630 -61366138376338663033373361666130313230353238353761353533636533376631353664316462 -3032353465333562640a366339346634646237326132643335383938323835643331353265386439 -39613234326430356134393936623031623664316431616230313066343165373835326534653663 -63363263646231396531303863616666383463616238323238313664396430313037663463306465 -30316536643863343735616232626566636461323163303935363363306131653832373965393334 -38376362646431663934616132303137306237346333646665303831656431623331346436333137 -38336563646433383335663364383961313030636131343132383835393630643561386239663263 -36636561356366613166663665663131666461313636626639636132316166356434666438333538 -61343632316535393062333037616464623138393533383939303862306361653135303861646432 -35376363666265346562316138366333333064336439353537656633616337306239656334356134 -62653439353034383933346638383663646362333761636163653739326165626362336231613339 -62343032353936386530376438396139316334323262343735646461346361333266396661353430 -30653430373563383262623132313432323761333063656133393462373932633137653032326131 -62316630636562623135656361343430623238633162636165663630333862663562393636326233 -37386462666664613165656435363530623738666432366431316663353439643363336132643931 -61303238343136346537316266633134393436386239653431613961313435333831396336626236 -31386566303331616630633438353061666334623035656539646364326663323338313535643035 -31386334653432363439396633663366666332626235343835633664633865653335396638333233 -34393933326237373561383039396631353335343266633263666662643662363839633339663734 -37323964396534326134613633346662396534383332643237396262626232613863323238646537 -61303134643161346564336634393938373032383862313766393331656465386337353035656230 -30363661386431383738646335643837616635313536613738613235643466393237363466303161 -31646435613963316430363638656330666537653834303133333537373234333834373037363835 -36373036396134663966623562616263656264353835356163366364623831346262333133326461 -63356537623565313834613134616132383738633234613861613261333366313439383735326337 -65363338316533363834656362373462366631323062666636363430303830636132396634663733 -3635 +36636439333831343465626631323737613065346238306165386661663539666665623432336439 +6164653730346661646364343037373538666463666638660a386534306135363134623431666233 +35346332636235333932643965303033336236656531326435626632346531343730666666313534 +3666306138633136660a313234343964356161616562356263656562323862303037383834636633 +61306333336432313634666366643338633065313531383164636335393339313935613662646265 +32363434373462616161633433613231303532633837373233656234353333616266323361316664 +37653337323030663531356134356633353839313564666636323738343862643236306664656563 +61313837363438353531333437616462643764363162666536313137613565353232363430646666 +31353566396238613537316666653437313639363133316166616134643765383435396630373935 +35646634373638343631626139363363323065626538383732373735386139336364633563636633 +66663931653033646464346139333738313232303635306133393364363961336637616262303833 +63313736373562396338666662386163386361313030316539326232383038333134353564666131 +63373862306236353761333261623634613064393835633565313836353935306438633035383832 +64313530613937626564303766353036636138663365633436353839636433303830373937346439 +65626363323966323066363866363663386433383961663939656262396463663632363533303563 +66623135323537613761616131353835373333653830313430613734303562653861636232643332 +62363363363231316661656365383937366466393337353365623534373332303932656630376334 +65303865386161323238306663383961623534613063383636393261313061343738633430346163 +33383837396661346433373366396262633761346165343130306233303035396432643536313766 +33633532363866396136616338303139343464653135633866313632636637383762356135656264 +3138 diff --git a/host_vars/brunsbach.yml b/host_vars/brunsbach.yml index a684859..13ca52b 100644 --- a/host_vars/brunsbach.yml +++ b/host_vars/brunsbach.yml @@ -1,30 +1,22 @@ $ANSIBLE_VAULT;1.2;AES256;fastd_key -37653666643834343266376334633065303734653235313165663536383933383635616331653264 -6163366238366366663033623636643666333236663831360a656535626162643633326237633036 -35376638633039626265623565363231323432333966306562333738386131636362323133383739 -3335336665666664660a636166356239393631633465613061333066303033656232636363393232 -39323634613362356332343964646335353835363530303539656630653065313739316534613062 -35656465353732373865393439356638373431363566376338653561656236353264313036313934 -63356564333436336437323664653533646537303265376337373261373731646630393562313833 -37613465323963353061343363656436366264353265343839303732323135323831636538643038 -63646163313431363332326463393964396538383131306539363433663432366562636332666665 -61633831636536313065316661663931396665386363653630373638643534653033306535316234 -61656636666562653563613831376363313233626561333465643862393832343432366235623963 -31383961376265373835633066656339643065393462636561616236633438333564353061656439 -35613633393264343630343361356265653832636635383936343237323332336333393536313862 -38306633663435323230653930363664333264336263653239633838333962356266633231656634 -34613438633065353234646435353735653936656530323166623430393864353261353936636435 -38663534313935313036346462366664366361613233396166616563373265396161626465393139 -35376464393432343262633962636663643938323932303639333437346265386435346166313732 -31626666333030653734323334656339373264346463666530323835613839316563313939316162 -39656665316134613537353664356339616634633931663634346164353161613434356164303533 -66343630393238643633373763623134333135363736653231373832316133343032383066393731 -66333235393662313735636235346635623939636235643536343538313038636233356666663631 -65633063306233616231313561323930626131333339636438646635373062306138363938303830 -66663630646432653832623937656238303465323066616233623932336430373164633766323662 -32396337643630343730323435383166333335613666613230636532343661393161363766353566 -35373031343065383536383537353835373863396531643931353939656166343663353732343564 -38356565653766373963376638386138613261626637313166353162376632326538623038396139 -38643132373865366139303034623731383538376132346432616135653465313961613263633938 -33626630646237336463623666303931613566343339333132323362613136323435393362653763 -34636536386366653066336237636233613339303265383939616335313639373830 +32353932343362303661303631326539333861353564373065393430353036366630316237383862 +3634376239393138336135343961376430393730346465320a333233306639303662633439353264 +64316563373134666433633763643239373863346635663063343336643166373865376363393931 +3862663630333634650a646534363031326261376561633266616434376334386563623961653666 +34343565353630613834393566373835343331616331643437336363306138303437343731373332 +37373262333030346436663030643132336265303864653464376266636465386131356239356466 +33373766663836333938393938323132613230316338643962643137396665356565393761653831 +66623263646263316261663638383837663835666163666434373436353038343064313964613437 +64396639626162313465303361373938333762316232343065376562316238363765333466393033 +65393531663963643338666133653438393737653632646434356138653565313165623335396530 +30653931653965373334663431363435306164616162616333376634356633393365346137396432 +62646337343365366562663433356536303335333832623565386235326532393261663136653163 +33306632643232643732353533623438323539363361626138313337623833616164343638356265 +62306636646234613362396236643039336331353533626565313535326635646330343838393862 +39383065373134386164363035363538303935653062653334323037636133666564636534366565 +66363436646636613038356437393063323865303064663033346431633031633331366333363537 +35316533376332376262636466386165343230373365343731393463356162626163333864323439 +61666566653739306563623364646337363530396439393061396239303366666330616130336364 +38616232353630376431643665326630333433383832316230306264353162653932663035343439 +63353664393235373662346562303461303963393537393439663132623338653838316639343635 +61633433623237636463373137343265646130653964613139373466393633306666 diff --git a/host_vars/heilsau.yml b/host_vars/heilsau.yml index bbf6e36..79b3649 100644 --- a/host_vars/heilsau.yml +++ b/host_vars/heilsau.yml @@ -1,32 +1,22 @@ $ANSIBLE_VAULT;1.2;AES256;fastd_key -66303230373863386634303532663630386234303565653366663163366632656165333561366166 -6630376334333330653562373865396333626338323264340a383161303031376536313137623737 -31323961383137633466366264633261636263396263303731623131386666393730303362366261 -3839643338376638390a316566653038333639613638386538336638316230323262616130346162 -62623264663935616330326232316334343865346232346561363230356363363036346662366462 -37313538636236633164353134306633313434396538613339633835353365306631323236613335 -32346337363866363231373531383166653564383134386162653632653833343539663862356163 -35323663336435633165343234333234643338333765643763623464646637323165643263363538 -62313036356634353234386166623436373032363132383632366437653735646263633935623864 -32666362393363343737383435376234323764623161326330396531633361633033613065663164 -64316438333232653161323863633639613463316236626161343839623833626530616533356434 -64396235396166363732653265643233633363656137616236303633636436343435633765393966 -37333036613432383433343138346132613337353464646366333139393239333664663536373136 -39633932343336353964303437333534663638383663373363616436633934643962633265346138 -63393331383232363038383133313662353264306362663263623236343630333039326233333732 -63323634333439336639353833623166653433393663643536376537323634313331336666313765 -62623362646134663331313561333538616433646333333463366564376230633062363234386134 -32633464353761616136383535656264356631343238626235333230623565343263643361643936 -65366135613930616464373238356230383233333264653534363430623264626365323263363065 -35393165373535653266636166383433643737303464643333366233663235333136386666656261 -37626564653666646538383264383337326531613735313865363064653135623238333830336238 -61643530313131663038353036383932663335333035333762373563613439326430323530303631 -34346436376465346563623166626663383965333130353531396230653966336338396639343161 -65653864386364316661396361323931623733396265313539656666656239636161643730353762 -39363537616432333661613732303766396263313136336131323638656631626239643232373836 -39613164383465313839323238353434373263343366613961353761326436333237646133313732 -36623132616236343931643438323665656339613033383335383861343635376366613632656565 -33343335623936363938376434333039333231353636313131323562623132646336623865313337 -61356632333461353731396236343236323363343830386630386530643536343632663566643463 -33363637383336316336383032663435623064326531373030326362636161623165373365313163 -633434653839643061333765353630626137 +31343362373064363463393062613161616665613561376639353565663164336533623437353238 +6635303334666132313963613232326333626338393266620a303134646662333834353265336139 +66616462383331353235653338626365303463346131316332396332353563303365643566323764 +3666623766626166380a376438323138653336363066313763386261306263396566306234393838 +62393563343563636635353865323535613037663961326436326462396336643432313365623435 +36333239353564333332653763616337666361306263646134303137373032333137643731656463 +39373630376463356362653131353232373638313136363066623133633562663637386132393133 +62383038313861333536633430333933343835643335663365653361343730653137316432346236 +64613439666565353730343635313535636537386634646131666133613139376536373466313537 +37373664613865303636623339356130636630353131346433646234643432343736313339363139 +32646664323734653364313139373161393365376333643262396535376666333737623734313035 +33363335616535663132303438336461393061663235356236323063623533373830316261633238 +39623035613532666432646432306562383332643164613933613163373434623465373933653861 +62643930326538363433333966393561383535393036646332356433326639353831643662366461 +33616264393162313039313362346537343539393136373665393065333962316435353932653764 +34356534323438333730383164353162663231666532313061383865613237366165653934653764 +33613266623131366437383162306638616637616432663164646336616434333538616561613366 +61653531666431326666663038386564653164393232393836656363313061316437386436323338 +64643132656136393237343536326164363233376262616634306539376266383366313138666535 +61383138626534613766396138623338623731623762326139616366623839633465623562393534 +35643038323135363534613266376232343338303337373061353465313535653562 diff --git a/host_vars/sylsbek.yml b/host_vars/sylsbek.yml deleted file mode 100644 index ee5c5d2..0000000 --- a/host_vars/sylsbek.yml +++ /dev/null @@ -1,30 +0,0 @@ -$ANSIBLE_VAULT;1.2;AES256;fastd_key -38656233336330313532366665646238663833373337316432623466386235303666313735313339 -6162313039313264383964333464616439343765383733370a663330336165356166393930303166 -38643237383165363135353632633036313464396166326534663362336137633964613231393737 -6436633938356463300a336532643463643463623339316566616465666436353634353235643464 -37366332663666303562363537313662646539666634653439326562386565633365633663356533 -62653463396634353966326531386134356232633636323461393737643837333130373561656665 -63636234613065346664326161616666396262613834373334383339303237333363633961643765 -37316633663138353639323932323864336536316434316635393130353363333063376334326666 -65326464366134333239323161323739336130626663343038383636663261643933646662646364 -64636464663563383936663936383266623934636137373439323961623732343438356663373565 -37396637633465623432393461656136356632363835663035313239663636653539383236303364 -33303365656531356331393538653566323864353432333738636334303737643837343833393964 -64343238333565346561646637653438313165303333653035396563313962373132326334326335 -33626133366263356430653030623662396635316333643262306531613861303431353963356436 -35393966613064353036373237373538323763663833346234366433313961326365383863356635 -61303664636538356166313833316339616466353834393534316434313565383539306234333238 -32306366353465623065303264396534313833626330376537373931343033383735626339616666 -31373337373836306235343365663664323762636531663736363338346635356365393865313131 -33623136336530353965616566663066343837356265366565633430346633373135623836663931 -33363833623634326462393932663139636532666362326232383838653439333731386165333439 -61343630353961616136666130653763346237643966363336306535343334646666616563616366 -62346533626638373135663834376363356265393736313432626134636234303665643537623231 -33386632383837636433646136393064333736386161383864643639343538653537356166396238 -64313938656566623738656562376537653839376131396538383536333135323138393565643731 -34636163363036353964626538626363303166366130356663613361353539633661666630643066 -36636232356632666434333436343635316637373563363435343138386432386539623535646137 -64386364613832336665346433356261623533653334633565306235326536616164363638613835 -38333161663734333534356435303037346539306463326332343065346538356666613130613636 -3065 diff --git a/host_vars/trave.yml b/host_vars/trave.yml index 77eecb7..620f7d4 100644 --- a/host_vars/trave.yml +++ b/host_vars/trave.yml @@ -1,32 +1,22 @@ $ANSIBLE_VAULT;1.2;AES256;fastd_key -63313865313866616164636439393033623834373033386666333065333166356535353638323730 -3933383565303861646534366163336664373361633261320a383831303330303737303135386336 -36616662303330303737363433393431373736636366303739373632333030613737653734633133 -3439613739353136390a373334346434373038303964313333373831666632326165343739623530 -34626137383363383336663034306134333435333837653934356162363264636462643735616539 -32303861633538396465393033663765633235323564373064643830333832313261373435383163 -63646234323930383033623338383535323262303565663330626136303031386234373638376534 -36666461613662626161326565333961396430376534323130383138333366333963383332336465 -36636666613530353639656134333266316632613237306238366565396630356232333035393936 -34333833313635373763306161656166333335373533313439666330366166303365306665333661 -65623365613837383238653134376265623633323137313530303631663032366338336633386535 -38636261386531383533333634303831326431343331636165643364333563396637613162366661 -36353736343365366262373639663463346465623633396339333464303566326234633664373636 -38376565356162343732646562303038386563633261393131363935313339333563393539303738 -36343166356635626237633364376364643562653734313636343765643266653035643565666239 -37323763383862376663316237363365386331353037656434363032643565626432643438386136 -39643866316162653639643037373863333032636662333739356330336439316566633731653630 -36653864623732643134646463633363613362313365653565373134313037306663383434333565 -62393830626536663763356138656636376336306438346161303365653034333336633237393530 -30646338636437363765626634613536623932333438393937323565316632636138336432346239 -63656630356462306266313134356432393837363636643565346365326136333432353938313432 -34613836656332343831383236656330366637363864336433353466313537643730663138346261 -63393537363536656633656233353135383962653162336661356564646637303435323035653330 -34366436376639313363393334633938653339366363613035366135363631393966343335636138 -63303339636636366363373936323931616165393365616463303237333133376431373035376236 -38393430323232383165333337343230666236353237663466633763333763386262346465353130 -37346664626432363163623162643331386334663561343133306135313837376537373830316164 -65383561393562323833323764376330363639616233383734646164343831626434313262376465 -34333230313762316233353163663963646533373831333665396335396462316165346635383038 -65323362313462333463303261626536376634316662303364636635303664316337346130666265 -376531353665646439633865303665653362 +38653834643539336536363331643532623663316135336636356234373732313635393635396661 +3338333530386163626639356265646438646366626432380a643834666139613862636562383032 +64643338656365326664386161633130313862633165353564316131646535346266303232333033 +3965376464303930320a613439383565323637386365383063303863616163643466333466633561 +37626436653764396235663835306662333530323532313335353862333266336463623533333338 +31363464646264636637366531623964343639616461326434636565313535333763653532343633 +65373034623864663938626632666236383866343331363865326438613636666336663137383032 +64373836653063326439363631346162386564353330663263313864663261643339333435306539 +31626430316134303261633866306431656539633432343635353934623730623933323732356566 +66393835626634396661313665353130366130363138356431363430663864623032623539393631 +31383364363664336661396265353864376234346230316662323565613165653536656463653135 +61623730356663303935613536316538376563376363656464373135346339663566633761666336 +65373634623762396530623732643862343762303666323234313437653763663738653933393832 +61396333623730626537353663613631633636353666333238323862323835393838613465653032 +32666130383636653361643437646365646463326266343664353062613838383466653662643935 +34393665636531626165653662343436333133633061623232653463643931643662633934356132 +62326163356663383266646430393330363130363238613138333933313830643961613233373638 +37313437373266316133336135386134303065336132316531316366623538613966643039636432 +38323966346165633463643635353962663062336535626661623366323065323365333565656637 +66626162653331663031323239396337373766333339326434633538646430656631303038636666 +61326363616564383730326665363137323534363534653463343231376565306339 diff --git a/hosts.yml b/hosts.yml index bf7c918..03ef914 100644 --- a/hosts.yml +++ b/hosts.yml @@ -65,19 +65,6 @@ gateways: ffsh_fastd_mac: 00:5b:27:80:01:12 enable_wireguard_exit: true owner: ulf - sylsbek: - ansible_ssh_host: 195.128.103.225 - external_ipv4: 195.128.103.225 - external_interface: eth0 - ffsh_ipv4_space: 10.144.192.0/20 - ffsh_map_name: GW_Sylsbek - ffsh_ipv6_address: fddf:0bf7:80::192:1 - ffsh_ipv4_address: 10.144.192.1 - dhcp_range: 10.144.192.2-10.144.207.254 - ffsh_bat_mac: 00:5b:27:80:01:92 - ffsh_fastd_mac: 00:5b:27:80:01:92 - enable_wireguard_exit: true - owner: ulf trave: ansible_ssh_host: 88.99.86.15 external_ipv4: 88.99.86.15 diff --git a/roles/tools/files/README.md b/roles/tools/files/README.md index ff40965..b6fc28c 100644 --- a/roles/tools/files/README.md +++ b/roles/tools/files/README.md @@ -2,6 +2,46 @@ ## This Freifunk gateway was configured via Ansible ## +# Check Batman Status + +batctl -v + +## Fix broken batman-adv module + +Execute "fix-batman.sh" in /root. + +# Fastd + +## Stop fastd service to prevent clients from connecting + +systemctl stop fastd@ffsh.service + +## start + +systemctl stop fastd@ffsh.service + +# Wireguard + +Check status with command: wg + +Check connection via interface with curl + +curl --interface exit https://www.google.com + +If you get lot's of js, html and css it worked. + +## Regenerate config + +wg-conf-gen recreate + +## stop + +systemctl stop wg-quick@exit.service + +## start + +systemctl startp wg-quick@exit.service + # Fastd status via nc & jq Search for a key, part of the key is enough: diff --git a/roles/wireguardexit/tasks/install.yml b/roles/wireguardexit/tasks/install.yml index 0a0c9bc..cc1aa0d 100644 --- a/roles/wireguardexit/tasks/install.yml +++ b/roles/wireguardexit/tasks/install.yml @@ -1,15 +1,25 @@ - name: Install wireguard and other software ansible.builtin.apt: - name: ["wireguard", "resolvconf", "git"] -- name: Setup wireguard config - ansible.builtin.template: - src: templates/exit.conf - dest: /etc/wireguard/exit.conf - mode: '0600' - owner: root - group: root -- name: Start and enable wireguard service + name: ["wireguard", "resolvconf", "git", "python3-click"] + +- name: Clone wg-conf-gen repository + ansible.builtin.git: + repo: https://github.com/ffsh/wg-conf-gen.git + dest: /opt/wg-conf-gen + force: true + version: main + +- name: Run inital config generation + ansible.builtin.command: python3 /opt/wg-conf-gen/wg-conf-gen.py create --pk {{ wg_pk }} --address {{ wg_address }} --country {{ wg_country }} --city {{ wg_city }} --device "{{ wg_device| default('Unkown') }}" + +- name: Create symbolic link for wg-conf-gen.py + ansible.builtin.file: + src: /opt/wg-conf-gen/wg-conf-gen.py + dest: /usr/local/bin/wg-conf-gen + state: link + +- name: Re-start and enable wireguard service ansible.builtin.systemd: enabled: true name: wg-quick@exit - state: started + state: restarted