router: ansibilize routeur-aurore{,backup}

This commit is contained in:
Yohaï-Eliel BERREBY 2020-08-08 17:10:01 +02:00
parent 12b0bc91dc
commit 646ebd3ba9
9 changed files with 477 additions and 170 deletions

View file

@ -1,168 +1,170 @@
$ANSIBLE_VAULT;1.1;AES256
30303466313332386663653437633162366435303931386433386437393133326338653433383838
6536366261346666303239313536353263616235363761640a306262643931333035653162333839
31343430386661623938333332393336313564353435633961323532623037333535333966643539
6138306433636235390a353464616630376261613839643263613063386437313766666165613336
37353431623631363662346134386466346163616432353361356632313861323130633338353264
65353230643532343036353736623065383635333662363263663063363163656633646235613336
36323466353530303434363037623964303931643462323437313733366636303766633262303465
64333066313562313733356365636530316533633532636632626637626462636133666133353338
37333866333337353162386139376463313030346636336231626166663231626130343738633166
65343833316632643532393531363037313936656364356630616137373734356631333464396464
66643237393039633461363433386432373935626631313465656539656538663931313866343863
37626261373737666630623966333436336163636338336439653363356632656463346662333234
64663936323634373733333262646531333437393562376232633266343738643266353633663437
61656166363763333933323961666637653464396533356635643835643566633938363762313065
63396566313830393935653339666262346463626266373734356532306461633961333930336261
61383762643464396131653838376337353462396533336231353230306431373162306437633266
32626365363031646233663632353730366234366539326137623331386263396435386433396232
61633664636164373734623138306563643263363839313434643036396437653832343334613365
66643433393831646338363830653739316234356632666365306364653262613836653933636636
61623038303063376137633531386531386634313536323466623636313334393661636634373638
63383139343061643634346166303037636531396636366165306266346131326532306537663963
30666532376462306435383735643439313739343039613533653231353338393439376638646565
38323162343435643033336532353636663831313433626534653334343939623864656138653035
62383566396663653037623866633934363863646538306562636531373762613863343937383531
63303932363739306131643331323032626466636535613966663631646436353830356439393361
32353764383239386437303363323337666339663966653332303230653236616339353930336137
66646533366666663632383530373663653335303161623664633932356636343664393865336137
63313766313831346661656134353736666463336561343162326263376239373934373163393035
64303630663537623435356136336237386666313331666138366530356130306139323538353833
63633230333432636433393635383061656265376535313038316461363561363733316231386234
33366262343866323936623266353061613931396663386638306466343636626133393561636536
63653833393633346463643737346334646338383835646364633235393037643462653662353039
37323436633231303464386530303434636130336561653833666536303166373030353633656238
66663562393164303563653935333438336231613064393765653030373064663462363030356561
64303934663362633436636633613538353664633361353566623663643961663432386530376538
66643735383038366436323865383563353132626331336339393666333164396631376562396636
39316435343261656266643232643931356566333336303666623331316236346265383230333835
30636165316461393936633566346438616464333031343163636462326630653061353332353565
37323032333633653463383338333265386434306666333930326664363863663636366666643438
36346662326562366163303665376234336633646435313834616335313363363332653962316662
64376463356430613266626535353563326530626330356235346537656633313964383932356465
34336664353861363436306361336337323565376238373439626130393866663134396135643136
32346333386266636437333631363330663065613036303437353631303131373430386234316538
36373934373064366664653139336265646361363631333863383731363737323230613931353333
31666436653361333931316463643730366636303932333730623939323533613532396238306238
62353066646435663365336635393030346233333138333766613661613039393161333234613066
39663537353562313035363036343064323263623537646632393362613839383836643166366635
31656662663665383238656634363062393133343033343933353938326633343061313732346562
39376561633939616538303833383235663338636164613336333036353334313332666531366230
32373135336136343934356264656664653730313963363733313833306361613139643434646430
64343235366437363931623731353239623764343931633330343737626163623632353864646639
61636430373637316635323533373162633536393439393338623331303662333962613532323133
33343336626462626132376235303165643164313761313136376631653731356535363465666661
33363737363338366534333835363837393565653562623436333835653936663834376664333864
36643333353263303533623531373732616365333030643735363533366463333035363136616139
37386532373336663264643433633432653631313262333735353265373161353463303362353630
38666363336539633564306132376565616463643662343136623461363230356564386335643732
39653132646431636436383437366166373465336435356638643865346265643335383864363037
63303633616233333233343962343037363465623635653831656539363662373035663163383238
39643833356331323764386264373062306435383132656236313734643564396432396363363366
65663630336539353261323739633765653036356632303739373239323334356133373133383631
31343462323032393434326133343135653938353534666339356334636134363937363835646630
38326561623264616439386264646635373063353966373936346634316239323464313531353035
36656533333232313261316334323534336538626430363363353363363631386362363864616661
34656462373230633364663963313662343334633235643034663231626362646163333563386638
31363831363137353862613337323036626338653634653664303262656333663538633566646137
31333264383535323336613262643636323733336461313339643665356134376161323262363331
39353237653931316662393538383463373636653834333334303137643037353436303131353466
62393037363565616564393732326334633035353337616638366537633238353465346234643134
37303961343837636638303761313536663862333864663733663266623931353863323466636461
37353764353034383833383533626430376537376233346539663966323061386135663463323665
33333038363138663264326432313432666632333234376366663963356534623137333831353632
31623038653034666236333934646539653361343839333533636563303636303434336434363932
31376639336130353666363361633535323932376535626230376632613734653633323334633464
33616532336363346632356662396631633133616337663161646531386632353433613864386331
36356337346539313963396238346333323266366332353863653363396335383935343436656263
63613634643461333434623062333232623135626665623731366536346532613063653566386133
31336239663964643662373964643665616134653235666164656236306565623638623330353630
64396139343463383732336536623561363639366663636163643236336635323538323336666137
38373334393837393563333331336638376162303532393066343839343633616162326665313738
62643731626666336634303639376337366666306238663235636265303833646231616239316665
37336132303462306462386334306132353930643461303664666563613261643633636635363731
66633638313230363136343632626464336335643833613162383930346439313637646139623631
36376661346265333334666535323063656430306463613938366632306366363631663232663433
38313663663937336435643338623837653731333961356264663965373234353938623232353065
64633039316663343139666338363662393362643966613466316664323437396532356465616639
61326364663565643537633633316163646362613063653562646165326435353632396566626530
62343732356437613334363361373237643839323431366238316434376562326334343431353466
61396636396636326466386131653133316437306263303630363830306366666636323937653533
61616634616161333035303132353664393333316263313863656463393736356533636535623035
35363734393465326263383862613062613235663538386166333235653765306663383332653338
62323031303932626331633162393062643833383631333265303431653836336563313561303533
33643236663930653766303930646132383064663031373466633732376438323238383035626232
35356533613133326239353537383866306338616538643839343162623932613439623538643130
33363130366463356434623265326664353064656233373536353235663936363266623562663362
35613436333363376438643331353536666134303561613239626634656135303862323432303761
32326438313162633262653163643534393934353337393262333461313166373339333532373635
39326535303239386135326138666133363531353865663934326332356161356364313561613364
61363133336165646462373932643135653438626130643364626531346339656237373935386563
39313830396631366466363066653464316165306261306461343636656562653234313933316331
37323335653538663537646332616665303138346138363134393631336566326562346265343138
35316666333336663231373963383265633832656462313961376430613338616238613562323931
33353931666538383134373230353830633136376134326131386435353834366335666566396634
63363930366631313661363538616261363532373332613966363030363662356132373261343637
34303038653531383134326231333562643639666638653631633436323234643931653734333338
30343938323534353063643664663536353733343430616336383161643633616337383734366162
38363838633334343232353737303239643733646166323263363039353939633136616362393662
65653765353566616430373632383137386331313966393731393861353763323633643163663065
37613266326361656666653662303131343036383133646435656362623439313733323638623633
63366236326634643133656131363061353632386438336435313062653961363563653065346265
64613762393830616336346362373232623234303330613034326236636163616364303366313163
36613930616663643438373238336661663962616330383635653564353366383234653735656231
65393866653535616230376464653030346334343865303439636236656432396433663534333434
31336332303535386237333336636436396235653265323361393935323937393336336232303531
64303732303365333962356464663134303237326133333464616638303131306138626132633962
36353866313635373230316262326263623531316135663631363838633362316664626438313461
38613862376435383961376436643630653436343461336165656331393764646161376164666462
37633030383361393864643063353232366161353934343461393366356538373261333663656638
36663830633266663938333736366234376564646539356462393930643062666538306632393237
61356632633561386565613730613131343261386662656333313363336432383637386133346261
30396666646434666466626236666365323039313037636466636331373137366663623339643261
35643937666362316538613830346138363437376664633233666230663131353437666435613466
30346131373462356232613761356564363264646338313537366637396230313634653430323061
39386435666631373339666236623661633631623635313366383139636361356231393462613437
34373862646130636261663831376332316133396262316437633739383437646435633236333661
30336366306564393538623431396665626537313130656334636234313464376564613434633831
33633737613130643334376131356330646634333834303062613736393534313065623834346562
35393564383962636133346461313131363864373334653264633561326136323361313936653734
31383130663239333063623837373139633031363331663535633832653831303264336265666463
39353434383866666439633936353462303231663936633862303961386630636535656331373535
35366263646665623236656463653063383233306262396461363639303563383736323038663164
36363161346262306362366236656433353337316437373631363832303437633933386538366430
33313366616161646264333235623864626238646263636461393037373234333437363534363532
32386363656664303138623134396338316638346531366538636239303638626462396132373437
31653131313335306239393431353533633362303966353938623237356131386237616366346638
66623434313831366333323265653131323233373862383530633538623965393765323034323934
34326131303562646433343961626139356263396462626534336639623534663465613338636337
66363137313033373765626136616131363832653063616131666538666263646133613562383830
39336630636666386364666262623235386134353063323331376238616133336666306161383830
36353131316263633933356336653166313334363365383562373233356461383533326661663331
39353665363365333835383034393136353466323438633933363062393134613365633532613131
38626530353431636363626131333633626139616465643963306262333639356431313362363332
38386661343731393437393566613961383463646434653038323063396666653461663932376366
39663738323537363630363666323062623339633266303862376435393762303363366162313565
34616464613065383639633865373764363230306437303236616261333766363738343131623765
61373962343236333361396635363562343565386266383063633331366131306262643130653037
66383562326438383562656535373835353335316639663166343163623365613263343364383435
32336162356561313737333665383732643565393030643132333934373339643535383033313263
37333365386663353437636236303339633631613266343238636638613634336233353462653335
32316538646339663435363962626537373632303631653339306633336266623264396665376165
61623963366336306230333937636466383035383262356664323361326234343561336338616237
30373461343465646366373564363838326266326566356166333935356261633066613438613331
31363232653831636634643765323036663266643862363431373465313465316630313261353538
31356233363435323937393439333838373462313033336338356666343432656162626461643238
66386464316262303433363231376535363437653562326264313135643737383462656365666361
64366234633535333434373163333164643666653638386639616436373739353431313730346461
64366665336561313830393036616239376234343239383833376138323261633831303735303330
61643462353839633934326639663839386565353736356535383836626231323430366136626535
65366332383438343235623034636234613566653137386163626634653065626163376139313938
33646366626234663934666235393661663435336334333362626633353730633538346231643034
32303964363134336163356537663535306235363664623938323339643663336365373035393235
36313731376534356166333266383163663264646634396334303166343637626233333162326536
38343430396136663231343834373535336632666532313037373336383233306634306566396230
35653264643339613634343538336439356539346462663336316361663435376332323330373461
34313537646234383536633239363734356564336334633434383333393733323466336231666362
65353562623565656462316462643466386432303063363461373836316236616433646334666561
323965343133626434643938396633643338
61623264646363313062633131306234666436616566383936616431653033303531333738666639
6137653535623535333435383862306361376564396562370a366166373232343137363662356463
34383636393830386465323534373534336462333937316530666139633835356635356562353134
3234333736333831390a663033313531363838303566666530373432346536306137393561393734
32613234373363333233333630666464386437333337623434356161303834656662366661343363
62326164363764323365643166636664343032613835656663363636383963663138633837646466
33373838343439663830626432353332666138356564383864616632353063376634393032613231
38336233396263316563363332316131323439363664646237383731363930613563343763653537
66383137353633653931616564616365366564626431626439383661666535663430353463346232
31613536343566373437353738323133646439373465376632656530393033373037383864663937
66623563393138653437353437373138386365653433313166353231653530613935333038653830
61306239356433346438663239646162633838623036653439376362336636633862383266633239
33363666383934633665303537396663363339323761356439636331656163363436333865306338
63656166343835646262393634613865623936633566356531366663326431353836363238656631
31333862346266653933663236626234663865373936623334323433643661343634653334316662
36313262626230356531393661303834653263666138613435333538373330633432366338363131
33336566633030346136613566353366653333666661336463336333333634643433393333353061
65653236653362636564653932306131346532343738333361646563623865373538636662643932
37373961313935373964376336333337396135623764376563623431326266633434336665303864
34383836333762336665313635366166316339396437656330636432353064343836616362326432
34353532626362636661363631666335316564636237646336323666636661336532313266616264
37353637626636613161396430623139323662303862393439643235653833386166363332616438
62653439363861626437663736313436386138363466333566333335323265333930366337386537
63353931353165666337666330636363386463616463376336323834343666393331653863633430
64626636373363626335303234306662323335363130623763333835373438373733353136306463
31646363663463623635363537636338376131623766386339623763376532343733613061343736
31653764383737646132353537633631643265336539316332636465353638346163613036653038
64653238363661303032666330623334376130383365386334313137376339623164313538643637
32323539346664663237306630346365646364663231633162393265376433313633336661326137
35366662386235616531323264326632353635646337303830663364643336653039643865313036
36343634613563353965643330306134393664336238653361616631623837313764653835333464
31303835653265343466303363623331376631383064643336306166386632353566633231303031
64646338333961373237323563633462363236626134366430323334373864633731323838383562
65356137323234653932373438306335383666386433386563343136343934623936653565663135
61353366393735663064383234343435633738623233643535393337326531356131643131646562
34623862626430343464663230323561313736646135323339656562323332306265323765626130
31333531626236393165663236393464303338623937646331663563636336316166303462396562
66643638383432333035373431393463343831643731636133343538346431613236663266643639
39346332303537393031353231626433393165386437343361663335646165623165336337643237
30643466666462373937346162383032386361383439613332653162613765326237643038613665
38633134653934346464346233323563623139386235343766386661643861313638643936636439
34393039626163336636323862643237363633373339353263303035386636393232613536633038
32656335396564623133373439333065633638373032323161383436363966386535393135623931
62313838353034343033653130633666336433656565373836336331363339636330663836343835
64656461376235323133316135396464353239316438386466323964326139316564313938333363
66636337613362633639623265336434313938366666626434393532373534303865376632313830
32353861306165383133633132623939386338343364623132386135316361336238616432383662
31663763306431623932323930373637363633346139663539666236363032386535363932393264
63306437616635343263643162393462653835643038373961336531313635663732343062613164
63316463376239383634373461343533393730613235633765356166313131613230326562303863
38626365383035363130326365353366316635323832333630343934346632643566373062313963
38356165646438383936336431326566386564306636386432643537666434613434343235323666
32366432393663333632383333333837646237643730383438336364376235353463656238393431
34656561613566383761386233366637343230613634333062636239626639343132353837656363
63373264646631336664303662386531386635303861333662313633613933353063363832623462
35656536616333333861383930623237363062363335636231383033316465323339396530353166
61613935366233326532366135623939353135323336346630303933633731316461626463643936
64393430386430343362346334633036316464656561356132376365323463316631336530346663
65373432666436323364316633623734353464393036383065643832653838323730643163393033
37383639343061616563623365383564336132356162373937346338356562313262366261646434
65656631326334336230333862303766633363653863666330373530343132336262653763336331
31303535393231373833633631323265383435666665353461306638633031376339613230343966
31306134383164333763656262636537343563386336393734626139646136643635313038663830
65376366656465653165663762313738303438346136646638633962646466626339653566343530
33353061643730663138383662663233383864626631626238306266653734306161383431653530
38353262386439663331633465313262386630363465646661643366336438356163393564653565
65346637346533323338383233313434346361383139666363336435633535326434373438366533
64303737336631643735376130653031303533646464313562623036643762653937613735316162
61396336376534393738323830333864383533343834616432373731633431316662656137363030
36313566633863383162643432396235306661393563303138386339343462636566323135313631
32336365393662633932383665623561373164353963646464323163303039333035366562363634
34643731343931656239326165323962613630636132353334643866393933653631393134326635
61353538633337343935396566396437663137326161323032336665356531373433643231326164
38663463633863643636336337316162666339343630373366396634666363306137323161626561
33336332383330383761623636366464353163386633356132656364373962316437626664333439
38393137356364383535383231613431343261613036666238323431663532663333336563306239
31313931623665623661323433346138383430366433623738356366373337383263316435393330
30356131333132343333623732383263353330346635613833626562613536376232386663663265
39636239663139393761303363313862333834336265616330353933333935616637646639326461
34323231616662306366616665346239313839616435393738303833653138353135353161393830
34653163386161653536666330353431356133623639653539316166313661343136643565393735
33343966613534653034333261383136323135613032613063653363303437633832653834393063
63623738333361636638646234363665616563633534626638613938613933343638386165346537
61316261663039633462333637636561656166663430353037336530663036353564353530323663
61386164636461363831303231353733646431313334323761633835373832333663306336633836
63363838613434303066333732333237343264363238313962393230633165396135643431626664
35316663333439326437343331303639616365633938393039633362303135393230313261376531
62343533383034363331343661333036646530366665336431303561653138626262336239303864
30643131356538316434313665353466383539383034623830363264343736396130623265306564
30666535393839306333616134323333326535336564313735323864346139393762336265623137
33653734393464353833333939363766656436393639626161383666613263643064323933663834
63663761356233633134646561353631396364343761386631323764643631663564653265303330
38333466666634383666326132356132303363666136666132373161383863653434333633386238
36333361383663396238643433383338646461386363396563643133303166356538666435646639
65353034373263316139363464343434326362366531666233323366383331353131383634396538
65313631363564303133396462353934623939663739343431346465386430353030363235343032
33653065643334663737643961396530316336633562323733626261376462303366313462353464
38666235366365633833336630316564643132633839313465636164393439626635653739346166
61343765653037656533313663333139663364666239626263393261353732363639623966623961
62643266313734363064333063633030383865653665313832623535636666623364333635643238
64623233393962313032343938666363333533653331303334643032636561303030633066636634
35363864613430356264633936663833373739643562343631623336316263373939353563393634
35376466376161383563646430363432626639363436633365323137346338306161636230323934
38383238646366343766333032633038663037386339333038636136343732613838306130303539
61303963333035366330646636336530396331333739306666396333333839613536343337323230
31326461623731653461376132356165343130333235336130323361616333333762623131393265
36636335313539613565326537373565313036306465326631326332373364313565333834373232
36346166373433313033363533346565316535666538363538303134616365326336613461633931
39333633383939623633386263346637386465326139363336663738393538393039376338366461
64336138643166663362376339366537653463386265316434346532663633643765663339333062
34303739366634383330356161333031313465323235666437363136643964623431336133633031
62373462623531373665653137383833643332366562396134386536666666356139663631323965
33633266353062363339613139666534393737393765383830643731616366316164626335373564
38613533356661626163646138316163343938666366353964623131383063353534326637323162
66633139633861623765316631323933363662383234616238336333383135326166656530376331
30613534613636333533356666333864326438646462383862616338323864336136323566393231
64323339386363623063373237346362366665666662306266323338653561396535323766316233
30383036326331323563663533333166366130326262393732343135643463643064313364393530
39326332346635343333376636316363393230336563333261616263343833386334376636623233
65396330613837636139636132303530316236666132646266383466306663313038343833373734
35376339666664393533666134353330626163306432363634653364343934343336306264646439
66383138626232343639623033383565626232323830626362313733666663633037343737623333
34653665666262303236616534343436333334393837326661383932623430303038623538313463
38373233373730633937306638333966653433626666373565623866646665643231323065383230
38353961396438373236393038626237346162653966383364626366666335656465346336323830
63343937363732326239396664663963633733643036396164343038613136373037383664646130
36386564333734643336303661336230363865323936343732646564336136653732363334316135
38383935396161653132396661373636353761616661616635303465653266623337303534353038
61333937393534336533363933383461303539303964353164376134653134356439356462376161
62356333363238376139356231373835386139363637336566356132363932313639643334396334
36326630663532313536393139386336303833653833323532653230613166376233633739623738
35336138343434343064616335373836363032376537386439323165336365626230316435623766
33653434633766323864343031346565323936373133396436623036353563653236393230653065
63616336316339393034643063376137663565396137356461303061626336343437316462653437
64383765376439616232663936616564366136666139343663336634366530303561303163373339
66616233613532636138613836636666323237646566356538376566626639356436376230306130
64623430613962333537366235616631323833626163383138393662623539643864346436346561
64326636396235613534666534306639363864303539623563333934353766306130356564333538
65386338616639663338636337303038316633383866346362633636653162353433366131333866
38643037646531643633333334626163353833623833616338373863373533316561313361616462
36323533343932376633653138363162646362313332353065633561666664663436376230376432
31373461613033306434313136373532303666306130353064326436373961633534656462643866
65623238396163646336343461303137366135306263313035663461653465346638383835666362
30306431396136616334666631646662386533343238323962353837306139316335386234366333
63343564386630356566363234636466303162643438653561323263336464633964616162616366
30376532313739306339336366306262663230366337313662313036303436666563326236333961
61373231653433613861633363333633626366643133633933333363636635656530643464653834
61306633333032316531396165366462386230336330376239653436313836643435316533613331
66623261396262316133326233316361656634333936353531623964313235333739376137633961
31656631643966393164323463373832363538653235333165333061653163333436633335633632
31613930333061653331303863303233376431306361613230383763623231636330343566323237
65306430366133393332386631356135663134306264633536636134623230386635313231343661
31383638616565363364373561613162393133363538626332363964663139336466336538333139
61613939653866333037393564383464663331306439643163343464373766313139656264316163
35383461663231613539613462336162353635333030323663333139653337663932633035666336
65376264306639316137383730626561396365316661396564623335313865313263646536613233
39313365333736363861666363383537376666346533383865636535343764326635343061366535
33323336303861393862623832353936383537363238623932643035323863303865383233633432
39366637656264656463393664336565366465333766643437623164636565346364623730633234
66663432383765643161356533633564626463383237373330663836346232636635373330363161
36303039393035396364666366373664623031363836646233616565346634356130646639313432
33323736373133383666613565356133343266343432633737313030663466636135326364623639
33633337383762333634613637383731613031353834663262313230303166376361373931623836
33663232633661373663376163303131373363313036666262613866633237373261393130626364
63343535396462316536356334356463323466656633373439656161356162386666386461336163
33373233616539653634663136623630626137663832313361313663306438643737393262653862
38313233396334353433313162316434653162653739663935396539326330383439366364343532
38336266353964656163346537333166366431626239356465313634623035373861333663633862
3164

View file

@ -0,0 +1,4 @@
---
apartment_block: aurore
apartment_block_id: 0
router_ip_suffix: 254

8
hosts
View file

@ -12,6 +12,8 @@
merlin.adm.auro.re
[aurore_vm]
routeur-aurore.adm.auro.re
routeur-aurore-backup.adm.auro.re
radius-aurore.adm.auro.re
dhcp-aurore.adm.auro.re
dns-aurore.adm.auro.re
@ -111,7 +113,6 @@ dhcp-edc-backup.adm.auro.re
unifi-edc.adm.auro.re
radius-edc.adm.auro.re
radius-edc-backup.adm.auro.re
routeur-aurore.adm.auro.re
ldap-replica-edc.adm.auro.re
ldap-replica-edc-backup.adm.auro.re
@ -150,6 +151,11 @@ thor.adm.auro.re
###############################################################################
# Groups by location
# -aurore services
[aurore:children]
aurore_vm
# everything at ovh
[ovh:children]
ovh_pve

View file

@ -29,6 +29,11 @@
- router
- radvd
# No radvd here
- hosts: ~routeur-aurore.*\.adm\.auro\.re
roles:
- router
# Radius (backup only for now)
- hosts: ~radius-(edc|fleming|pacaterie|gs).*

View file

@ -2,6 +2,7 @@
systemd:
state: restarted
name: keepalived
enabled: yes
- name: run aurore-firewall
command: python3 main.py --force

View file

@ -1,5 +1,16 @@
---
# XXX: YES, this is ugly as fuck.
- name: set IP suffix (main)
set_fact:
router_hard_ip_suffix: 240
when: "'backup' not in ansible_hostname"
- name: set IP suffix (backup)
set_fact:
router_hard_ip_suffix: 140
when: "'backup' in ansible_hostname"
- name: Enable IPv4 packet forwarding
ansible.posix.sysctl:
name: net.ipv4.ip_forward
@ -12,6 +23,13 @@
value: '1'
sysctl_set: yes
- name: Configure /etc/network/interfaces for routeur-aurore*
template:
src: interfaces-aurore
dest: /etc/network/interfaces
mode: 0644
when: "'routeur-aurore' in ansible_hostname"
- name: Install aurore-firewall (re2o-service)
import_role:
name: re2o-service
@ -25,12 +43,21 @@
password: "{{ vault_serviceuser_passwd }}"
notify: run aurore-firewall
- name: Configure aurore-firewall
- name: Configure aurore-firewall for local router
template:
src: firewall_config.py
dest: /var/local/re2o-services/aurore-firewall/firewall_config.py
mode: 0644
notify: run aurore-firewall
when: "'routeur-aurore' not in ansible_hostname"
- name: Configure aurore-firewall for routeur-aurore*
template:
src: firewall_config_aurore.py
dest: /var/local/re2o-services/aurore-firewall/firewall_config.py
mode: 0644
notify: run aurore-firewall
when: "'routeur-aurore' in ansible_hostname"
- name: Install keepalived
apt:
@ -40,13 +67,21 @@
retries: 3
until: apt_result is succeeded
- name: Configure keepalived
- name: configure keepalived for local router
template:
src: keepalived.conf
dest: /etc/keepalived/keepalived.conf
mode: 0644
notify: restart keepalived
when: "'routeur-aurore' not in ansible_hostname"
- name: configure keepalived for routeur-aurore*
template:
src: keepalived-aurore.conf
dest: /etc/keepalived/keepalived.conf
mode: 0644
notify: restart keepalived
when: "'routeur-aurore' in ansible_hostname"
- name: Configure cron
template:

View file

@ -0,0 +1,49 @@
# -*- mode: python; coding: utf-8 -*-
# Re2o est un logiciel d'administration développé initiallement au rezometz. Il
# se veut agnostique au réseau considéré, de manière à être installable en
# quelques clics.
#
# Copyright © 2017 Gabriel Détraz
# Copyright © 2017 Goulven Kermarec
# Copyright © 2017 Augustin Lemesle
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
### Give me a role
role = ['routeur']
### Specify each interface role
interfaces_type = {
'routable' : ['ens21', 'ens22'],
'sortie' : ['ens18', 'ens1'],
'admin' : ['ens19', 'ens20', 'ens23']
}
### Specify nat settings: name, interfaces with range, and global range for nat
### WARNING : "interface_ip_to_nat' MUST contain /24 ranges, and ip_sources MUST
### contain /16 range
nat = [
{
'name' : 'AdminVlans',
'extra_nat' : {
'10.129.0.254/32' : '45.66.111.{{ router_hard_ip_suffix }}',
'10.128.0.0/16' : '45.66.111.{{ router_hard_ip_suffix }}',
'10.130.0.0/16' : '45.66.111.{{ router_hard_ip_suffix }}'
}
}
]

View file

@ -0,0 +1,84 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# VLAN 129: routage
auto ens18
iface ens18 inet static
address 10.129.0.{{ router_hard_ip_suffix }}/16
gateway 10.129.0.1
iface ens18 inet6 static
address 2a09:6840:129::0:{{ router_hard_ip_suffix }}/64
post-up ip route add 2a09:6840:10::/64 via 2a09:6840:129::1:254 dev ens18
post-up ip route add 2a09:6840:11::/64 via 2a09:6840:129::1:254 dev ens18
post-up ip route add 2a09:6840:20::/64 via 2a09:6840:129::2:254 dev ens18
post-up ip route add 2a09:6840:21::/64 via 2a09:6840:129::2:254 dev ens18
post-up ip route add 2a09:6840:40::/64 via 2a09:6840:129::4:254 dev ens18
post-up ip route add 2a09:6840:41::/64 via 2a09:6840:129::4:254 dev ens18
post-up ip route add 2a09:6840:50::/64 via 2a09:6840:129::5:254 dev ens18
post-up ip route add 2a09:6840:51::/64 via 2a09:6840:129::5:254 dev ens18
# The primary network interface
allow-hotplug ens19
iface ens19 inet static
address 10.128.0.{{ router_hard_ip_suffix }}/16
gateway 10.128.0.254
dns-search adm.auro.re
iface ens19 inet6 static
address 2a09:6840:128::0:{{ router_hard_ip_suffix }}/64
# Ensures internet connectivity when running as keepalived backup.
gateway 2a09:6840:128::0:254
# VlAN 130: switches
auto ens20
iface ens20 inet static
address 10.130.0.{{ router_hard_ip_suffix }}/16
iface ens20 inet6 static
address 2a09:6840:130::0:{{ router_hard_ip_suffix }}/64
# VLAN 111: IPs publiques serveurs
auto ens21
iface ens21 inet static
address 45.66.111.{{ router_hard_ip_suffix }}/24
# Nécessaire pour contacter re2o et bootstrap le firewall.
# Ces directives sont _aussi_ set par aurore-firewall !
up iptables -t nat -A POSTROUTING -s 10.129.0.{{ router_hard_ip_suffix }}/32 -j SNAT --to-source 45.66.111.{{ router_hard_ip_suffix }}
up iptables -t nat -A POSTROUTING -s 10.128.0.0/16 -j SNAT --to-source 45.66.111.{{ router_hard_ip_suffix }}
up iptables -t nat -A POSTROUTING -s 10.130.0.0/16 -j SNAT --to-source 45.66.111.{{ router_hard_ip_suffix }}
iface ens21 inet6 static
address 2a09:6840:111::{{ router_hard_ip_suffix }}/48
# VLAN 110: IP publiques adhérents
auto ens22
iface ens22 inet static
address 45.66.110.{{ router_hard_ip_suffix }}/24
iface ens22 inet6 static
address 2a09:6840:110::{{ router_hard_ip_suffix }}/48
# VLAN 131: onduleurs et PDU
auto ens23
iface ens23 inet static
address 10.131.0.{{ router_hard_ip_suffix }}/16
iface ens23 inet6 static
address 2a09:6840:131::0:{{ router_hard_ip_suffix }}/64
auto ens1
iface ens1 inet6 manual

View file

@ -0,0 +1,121 @@
global_defs {
notification_email {
monitoring.aurore@lists.crans.org
}
notification_email_from routeur-aurore{% if 'backup' in inventory_hostname %}-backup{% endif %}@auro.re
smtp_server smtp.crans.org
}
vrrp_instance VI_ROUT_aurore_IPv4 {
{% if 'backup' in inventory_hostname %}
state BACKUP
priority 100
{% else %}
state MASTER
priority 150
{% endif %}
# Interface used for VRRP communication.
interface ens19
# Shared by MASTER and BACKUP
virtual_router_id 40
# Timeout in seconds before failover kicks in.
advert_int 2
# Used to authenticate VRRP communication between master and backup.
authentication {
auth_type PASS
auth_pass {{ keepalived_password }}
}
smtp_alert
virtual_ipaddress {
# Routing
10.129.0.254/16 brd 10.129.255.255 dev ens18 scope global
# Adm
10.128.0.254/16 brd 10.129.255.255 dev ens19 scope global
# Switches
10.130.0.254/16 brd 10.130.255.255 dev ens20 scope global
# IPs publiques serveurs
45.66.111.254/24 brd 45.66.111.255 dev ens21 scope global
# IPs publiques adhérents
45.66.110.254/24 brd 45.66.110.255 dev ens22 scope global
# VLAN 131: Onduleurs et PDUs
10.131.0.254/16 brd 10.131.255.255 dev ens23 scope global
}
virtual_routes {
# IPv4 gateway: yggdrasil
src 10.129.0.254 to 0.0.0.0/0 via 10.129.0.1 dev ens18
}
}
vrrp_instance VI_ROUT_aurore_IPv6 {
{% if 'backup' in inventory_hostname %}
state BACKUP
priority 100
{% else %}
state MASTER
priority 150
{% endif %}
# Interface used for VRRP communication.
interface ens19
# Shared by MASTER and BACKUP
virtual_router_id 60
# Timeout in seconds before failover kicks in.
advert_int 2
# Used to authenticate VRRP communication between master and backup.
authentication {
auth_type PASS
auth_pass {{ keepalived_password }}
}
smtp_alert
virtual_ipaddress {
# Hello zayo
2001:1b48:2:103::d7:2/126 dev ens1 scope global
# Routing
2a09:6840:129::254/64 dev ens18 scope global
# Adm
2a09:6840:128::254/64 dev ens19 scope global
# Switches
2a09:6840:130::254/64 dev ens20 scope global
# IPs publiques serveurs
2a09:6840:111::254/64 dev ens21 scope global
# IPs publiques adhérents
2a09:6840:110::254/64 dev ens22 scope global
# VLAN 131: Onduleurs et PDUs
2a09:6840:131::254/64 dev ens23 scope global
}
virtual_routes {
# For IPv6, the master router is routeur-aurore, NOT yggdrasil,
# because yggdrasil doesn't support BGPv6 announcements.
src 2001:1b48:2:103::d7:2/126 to ::/0 via 2001:1b48:2:103::d7:1 dev ens1
}
}