Merge pull request 'Backups with borg and borgmatic' (#39) from backups into master

Reviewed-on: Aurore/ansible#39
This commit is contained in:
jeltz 2021-03-15 07:53:33 +01:00
commit 4305a60639
23 changed files with 570 additions and 213 deletions

View file

@ -8,4 +8,5 @@ warn_list:
- experimental # all rules tagged as experimental
exclude_paths:
- group_vars/all/vault.yml
- group_vars/all/vault.yml
- utils/

9
backups.yml Normal file
View file

@ -0,0 +1,9 @@
---
- hosts: perceval.adm.auro.re
roles:
- borgbackup_server
- hosts: all,!unifi,!unifi-*,!wiki.adm.auro.re
roles:
- borgbackup_client
...

View file

@ -1,7 +1,7 @@
#!/usr/bin/env ansible-playbook
---
# Install and configure bdd servers at Saclay and at OVH
- hosts: bdd
- hosts: bdd,!re2o-bdd.adm.auro.re,!services-bdd-local.adm.auro.re
roles:
- postgresql_server
...

View file

@ -98,6 +98,19 @@ ipv6_base_prefix: "2a09:6840"
is_aurore_host: "{{ 'aurore_vm' in group_names }}"
# Borgbackup
borg_keep_daily: 7
borg_keep_weekly: 4
borg_keep_monthly: 12
borg_backup_directories:
- "/etc/"
- "/var/"
borg_backup_exclude:
- "/var/log/"
borg_encryption_passphrase: "{{ vault_borg_encryption_passphrase }}"
borg_server_host: 10.128.0.4
rsyslog_outputs:
- proto: relp
address: 10.128.0.241

View file

@ -1,210 +1,214 @@
$ANSIBLE_VAULT;1.1;AES256
64396638346335393963396239326463353436373937386664393164373338376461636666326432
3839376164613031613166313535346136396465383365660a376666373138363930393761376166
35663763316466336162316335623362633131636264663239316264666234393637333931616139
3434636563363237300a663032636362343739343363356363643035363431373963316161303666
30343866336465623738613739333030323537376663383265306237346537313839656137353565
61303237643462626564346539343933313334663330323565396438663633316239333064376664
31356233363431313161643131303234616162613164643539643563613339313432333235383863
61376431316661626465383562386235616166353839616235356366386534393334373064616636
32623832643533663536626130333234366366366635393038393437313139383061633030653235
63666366333732626166653831613731363865313461636262346635666363373938316266383738
33306632353536663138663961623964636436373564376431623165623031353737366539313966
36373533653139373866666435343730613530646665343333643764666263626433363262313337
65396332666632323531333364666330366430356437383338303665646233383931306166326435
35653538643332353536626336323034353630353564633264333334613531363839653362663730
36326562383934363034363830313139393361363638623139663538653138393533626238303836
38326561366536353036356163656130633430306635393763663664643936306136346163383237
37653465656335306565333432643863623762366134313137326138613336323664323333313166
66363438636161613362346633346434663364396536613932616461613963383339336262313731
36636432366332356435643266353362333437333131343961336639343234363636353535636464
39353330643136613463343435623939653964346334616131393566623330386131333262666539
35656662323332373330353231393462646564393431646238653438386563633365333162656263
62623536316165316662653832393364316439303865326631636337373365333035336339666666
31323864303136616365643735306332326237666136306435626534363739373332656332336639
38343566643062616434656338646235343234333031343038346630306639633732623733313039
33393965653839396166326565653963303137316666663135373338613265613239643661336537
62306634326266323662623733346164383039653936326162663165316439653332313730313535
66613335653463396662626230653232383664363137323462353037303633633666626433306630
39623933343736616630333539393365396636366331393136343866323766656435613262383938
65383663663237386631333236363061306131643133336432313035396264346631656264356530
30663636653434323531343233633431313838636434666537373439333364666635363731316464
61623666653561623233623131666464396530316439626135653933343531303938313965393438
30346636363136386264643161666231396533323765343434346633303162383762663763616537
38656436353661326165393934613235376565316663643930656338333932633664643562633235
61656232613164643735626439393731626430343437303732393163616432616336323436643737
63626564363464396561356366616466363035663864306561616164373639376431633264633532
37316565313636363536666566313663653637333665343036363261373765306233386535326463
34316461346364323837326462386363313338666563623135376163656330393830663031326536
35373935636538656566646336633435643830346136663262386463366563613665613032336533
36373837616132666630393634656232303362613038353764353362303830323536373639306666
66306230336430666435663061616264343137303564303764356130396434666138373132323066
33623465663535643736383032396236613632643537633064346631383539366330363436666633
34323133626638613936636264346662373739616136663165626339326333623365336161653230
65626131643832306664666364333961633535313164376533343334613666303331333036643431
65626566613937633137343538323563373737623265353436336234316439316434613962313030
36366634383633363437373862323764366263623063653932383534353538363866643437303637
32346533643438323632653830626163666463343366346531383830353833346164313537326332
62623462316161663731653832653064313436633931393565323631306134613962396338353039
39323037366235336239646539643265303061623935636263336435653831373463313131343866
61666265616335356530376633343762343734373539613865333065343066343963383634653436
34363431356264373166663632643232646261323332636263383065356564383663363439373732
31636238346661616563646262353962393266613137363536346534313764376666313737306530
63666263346231353765623130396530623362383165373863383537633464636136313130373566
33396137366538656430653065373230376236626439316232396630326537653936356461623534
65623562306131613633373632356264366439373137356132333062343839383132643834323463
31353034306339663365343234396466396463663634613433663262623038363331363161623831
33366137643963633066323837363563326137383834346430316262353834353238336264373235
63353330656166333132306665623835316439623239333539626364313535616230626430313663
32323335653433303233343336663935653861393961626636623264333030383365623838653862
37663336346537336530656161613539666431366239666461343139343461613033336535306263
66326365663132333165666239306532386338323237653832363763386464333634383731393033
31666431366432303036313765616432353061616462393236383131373938353238613966383232
35376635326534386533653834353966633765303165633036343133393836316637313531636333
32376532383865323731306237633565663032666631616463636237313938663034396363373632
62613030666166343262333865636363346131393664373633313064656463366533336335316435
31653531366436646365636139663236393464636366666334336433396365663634336263323835
64653634326638393133346335343665343265333133363236343566366561653831313561326239
66393663336632333931383766633966333763333632393633353537333834643465373237386435
33366638643861386431313030623465633938313932326264396136353336653163373636633762
35313463313066373236623466356333616238343034616436333437363033343436353265613932
36646538663734346434313861363664316538663766383462633434343666343230306261663231
33643031313432333330363664396438663933636465303731373065386539363762353530323063
34383434393062623037356637323264663961383166373736376136336237613662363038343931
39393766323163333431373466303739363566623464646532666330653132376466346136303735
30303537353863623164373362306334333134616364323366326636323463346461326366303034
33646230333263366137313234646265653339326533666361363632653166326364336639333131
66346234366334316539343734633164656132343130303939613030346263616632616434653362
66316165626236343464373631623034396634313637303737643165303939333130313333393732
34663134373864626466376332373731393039336336383937646535666362386666663765623132
66313363313162323663356230383231376539363732396630623061663361373866316432623066
36643739363361373833616237353664313666613036666161623935343233346266626165393134
32346361323462393830366161646630303836376431316566613631343938316362383663343233
64376265353166303032373664336632616337353339643061623661663066363433616239356561
34633339323161396466663435396565383636653830373865346363333531396637633332653866
38633535333035343630323633363564613030653834333538616461653566636638646137396266
66613235306361653463643532313435383366326430383031306665373764643632653962623535
61363438336136383635386336363533613863346264353530303565353761626466636136306335
31383035326163393563383038383037353037666661363531633836376638393935336639333761
62333030326639623034326331643033326431396337376630333937623063313634353032326530
66393261663331313139643232313661356664653536326665363065646163626236306637666163
33373837343331306632623865316461336466656131303638303035366564336330613234616535
35356361623634646163646436623364353539623131333966383632383566313363613032393363
65313136383834366564643234643039386664376362353435613433373266616261633263386334
34616633653735373361656461363462636666656661326637363262363539613164336464336631
31326535626635333662346433656262633031643134623862653831643333396633363062356361
37343530643633663261323037333830393737366134303035333232343232333835653731623332
62333739346563353737386664663864343561306164333432306231626233646131333264656666
30356138376336373436333732383835303230323039326165633834336634626162326439613961
39613435326330383662373732373537633535633032366131633062386332343264363135383038
63643661653838636565616239353566636137656139323265326534386434306333343631353762
32616466323663653564363832613265323534336664353965363138623762376539346338316135
65303334313362303532653438313837336334333831343331396563626131633937386437333133
36663834303337666461313564366561353265363263316438303235393465646434663961646137
37646332306539393162633339643434396531663534633763616433326363383332373233636437
61643037396361623938386466313736313235323165343964346463346339626632383535323630
33396135303434666233353631616436653262646136623035376232316264343930626435303634
32646133303963343239383931653631653036353535333665373536366464366466646330656466
66623136333437346637343534396430313838636665663933376263623362363134396330356566
37616361326463323164663036386439373539663164393038663636643166383131616164643765
63303339653835353161663637323138376233613265373461316430353331633938336662656464
66613464666634363931303232326461653239396234303863386533333832663530346261353135
63656636306539353139353763663461336630373463353162623566383230366366653665326166
31393333376434313039396234393839643863346363383535653465323261666432633935336135
63363864386135313438373532353266353334616635653433613765393265363465656439356139
30643864343166353263633262663036613766396633343564363633303165373631633965373730
64636561663438646562363765623435313866303534623038383731396638306536323732626231
63343538616631363736336164316531653137646537303436343336653434646133336534356539
64306139643537393361666161623261353763646631386361666637656137633266343238656632
32333866666233636164313131363666376261663930653330393436666464653731333164643836
63386163363463343737386338653636323230653336393765386538393563356435646439626565
38623439623364326634616639303734383330613133393665643963313932316365656563383039
61643739333434366162663438613966343534393438373135643064623465386236353632646562
64346137393231313461393436626335626461343661653430396536373437306336666630313934
38616638336638303530346164663033613332366133656435656131356262343635386136636361
39623161383636373664396535366531396231643162353938663230373762626633663638343937
66326533386564353336366561316361646333393130316530366434383931666661646636373835
64323135356630656134366231646130626162356237613337386232636333383261376535653032
36366338636565616537313337323964613030393035393839626134373135646663636263633964
66623036633266623566646566386234356562396164366166656230663738633665333531653730
61383263656235313463666439666563656432363332616633646139363135316638613464383239
32633732653837326332326363326265336130633065623963636338323662383234623438623333
64653038323566326366336634313637363132343030633966313363646665313835343833376632
39616364616236396265643232336365356235333064323432326561633730386533633064393832
33313838373236386463366162386437356365346631633639613436356635396238646361376434
34626238333366343831393364653064656166396535343133343131316537653263646239323061
65393761326462656265393235663037323638333831623733323430623238626234303031303866
64336130333164306530333062343161653532383031336464363237656264363665373739626630
64353861383364386632613335646562623535353031303831653436633330663337613338666331
37396466633231303032656334313033633865636231613564303733633462366162383835623563
32616439333064663234663037623832633933303664383732646238376465353763646637623137
66623664333364653039326431333439373934383735316231373164376365646231353935623664
64653839613332626638623039366165356630383539333736383738326561313838383131633236
30306537383865326533623337346138376533376137336536343163326534396564656130326361
61623063636138323965643737313262616532346533333137346232396561373735376130356132
37646639383430336637646134353732323262333732323434353265376262353039633963313061
63363663353532633437333335306662313133306565623537666232353665333631653263663463
63656264333064333662343836366131333534386662303933336665353361663938346430653264
66383539643537313436373434363536376137333636363833626361376131633537643334383864
34626264666437323930396562626134653063396533323139616264313063343535623636626238
38366437626534376364623535613432313636366332353830616238666534363561646438343235
62613664313631643137643765626437363962636137343765343562613761396266626461393236
63613134303065623031396231366130373432633738393139393331323764623963346565373839
64356439663964333032366363343461353130326136363731386535313661663135303237386638
39336531333064613731323066376461373732323437386462353432613464663666363832653866
62666461313734643562346335393434653933313661336236383933363738323066636562363230
34666136626566376264623734393837353466616461666132623333656135346534646462633739
36363331383337343561326536303263303739656562653536363234636130633563663161353631
66613338323461623534613935396638343230643330636562353936343333383834303466643939
36346532663237616132633166323630623434353338366534373366326234366566383931343837
34613134646563383662656533666163653265326433643832626435663361336361376362633938
38326235383664653366353162393034323866653339383139306630663835306537663563366231
35306362663930326133363835643262393439346437653935343030653161303361303939323235
34363438313763623934613534613334333464366361323164323337316531303332663433376363
39326239653731653766303135343437333431636362666231393938316634663631353539386463
66623730356336633536336634313264336236633664303864373735663837316563363666363037
39303330623765316334666132326134376636303633393736343030323837383666333832613937
31383033663638373666626336636539636665386465666237323232643466383236313262383235
63303866366162393434633631323539633565363036326264376339666637316133376537633163
66353264353337653733353034643030333932313463393132396632353030656134313064326466
65636330346433643732313033643032393261313736343533636535643439336530663261353961
63326231643131613665306563646331323536396232633366313036623136623636376336383438
31363764323335666464623330333265386236643038353164303863356261653634316536303734
33356630346666393539393931393661656666386635663965346537353365396330613061663939
37386638653737383434393438366661303337636263666665373935316439386363663936646639
65333532636161353538363161363138356364303661396166643435386234336132393733663562
64383030656332343736626161653034333539343562303530336165373961356532663234366237
38666632616439343437333366623362626339363535623162303437306334643731633662343162
32623537383966623866613361383266353936643462613964646139653532633864643931376631
62633433613435356561316536663364656639373733646539316566373334636133383936303166
64366139616164636336303930306138316161306563623366633130386662306163386361353464
30393231666266383064343234636430356564323534353339396637636632303962633665363661
63303733333137393261316436373864333734613136373633343564373537653935366333363464
63346430643030323039343539356364313635653863373465303134353361653664333333356132
37623062333663323135613133373662626663353838623233386166623739656535613732636564
63333937613233643035353136386463376661346131616562393236623338636661636661373166
62663962666237613431396436343434353031303165363130663163616633336134353430326634
66383463363266346630646339643563633235623065666265643066313134383534666530356561
62373737313834373239396262663463613835643737383439653837376135303733366436333733
36363436386233663135646134386462306434303339656632313562623037633664346562323034
33303833373733383338306333323561656333313430323136326234343032323034646663333436
30316661636237333266656430376535366135353534633932356135383333646261663935363734
30666263643265306434333535346330313231386339363865643862366639663832366431663161
37646632376633323862303764363437613332643131623138393330353633323634303337616431
66336366646138653737333137396338646138613339336466356537626461346330646434613933
61633835653235333637623635353565376331623464636137393861633064353739323262653166
66393533656435306530653034313034356231616563393438333162393630306462313530353535
31656537626163316535376234393236336631366262666539613337633461396134396563326532
30386538383136356632653962643538613261356462323637316335323864613133316364663933
37633661306635323361336639633561663738396133623362316437303733313838313332303264
36363932633136373762363762303933306637646230303564313965383335386333646161353261
31663836366639326438626463326631343162616537653266366334343538643634663831343736
61626666616463303034323730653966383365613637633539646263396238656630333766633134
37326438366434333066666334323137343635396464366430633931366335353231643630383161
64353034313338346162653237666266333466313630313363636135393433653761326134353464
62306233663930383166313033373561366231313865303662316662663236343638383731633132
62663061613837633833613737666633343063333963626265303236366365303736636361336337
35666536383738636239626139633031376262306165386362386462346330386334333331376338
30386235333963333732343930613562316464323632663638323536613232666230303631336436
37643131353437393661663934306332343037323866656665613436393237333236636661333064
62303063393239373065346461326464396232356531393932623739643835356637
65616665376265626636393064366339323264623332323337356438303634646361303530626536
3134646236376339666130646239626333613866383766340a366465373839396639623862636436
34336636326332313432373162356565383034636366613135353037393138363466626235353261
3634306231333966350a323133396531626565633433313761343433303964316163643365626466
33376632643937663566386232383161303231326638356338383536626531313462636335363166
35353138393964663063613331386138363030356661633530313533336138336362306437626431
34613435383966333538363734613730386634393532653334393766613262666434303666386537
33643832653236313136663761613762656334356466623431383533333563646135336332653331
39376164363533383930343237366638323534313232613561643936336330353538393136363534
37353536623939386131616638623531326531316233656166383133316564393731623366353833
31613665303532303435363765373434653933386530356433653061623232306239316534653432
39663938616637363238623866303439326666303438613066633866343830303762633233383333
65343332616430613839636337396238666466666430383031663939323239383964346638356538
65306463303330373534316438313932373864626637643935636165333835373662623737613734
36373161386163383831623065323763356637313364303539343763653065383139623934353638
34373861616336363861363761373665393465623566393063346331333861326337316363373163
31633532373966656565303866653335356364633063313665386335663863363163303431656165
61383231666665346162303635393838323462613261663231356531393734313063663231616632
30343562366433363261393037313062343036663139353431663330383263316662313330636534
33666463393664636538376365663236613536633663303738373034303136383939343039316463
38363731333435333262383064336138303062303836303735383836626430623738666635383637
36383031646561666632666339616632366138383534393030636331323037643564306363303864
33616664326330656136336538363539623039376565383166373032386230383639326564343961
39623465366233383663383433313862306366643432623130363037643033366531376163386165
64353930386233373561356530316361623665643531333632376266633963303262346532386633
34363938363765313366636134636364616634393061333264386262386261383236386532393966
62636332633165383730313365366631303032336339346138633231656165646465643039666362
39613534303532616433646433616261653739663366383566303862386666383363633736306265
65366434626634303033616463316433393730373034666463663333376633656630386665313934
36626337383236373533623830326134303931653434613837353961366130623665623336303139
63616265366638393064666166343331306530313438636436306264636235643762623564653762
65393435363564366266313161393631383836396464643635643361363034306134626535353962
63393530313438383731303666343637303666616239643334626338393864613635363330653062
31633030396362666237376232306238373065616238373934313930313234353433343934363432
35633636656632643964613431333435656532653038373532343036396136636231306436326639
36376163656634303236396133316664613164346661346565646165303664343735303233636164
38393361343561396336333133326539346561373038613265666364316630363339336565363265
64623063346232346334373836346231353336383931393663373365623838363036643232646330
37303139663166653634336363626637653666363965383632313261326530323236303961343130
39663165303836346339396536313137636462373765313135303039386339393536303263636236
31333534323735373638666364643365396435636533393932643432386630663135633839643965
34346330613132383533393361626333636132616130343266663835616534616562646366366336
38303337373331303638643639373535633331626461613862333562653165306663383237383232
63303331656338656137613162323138333661613834323863633265353737633666336263636665
34393064376330306562343930376337626165373562336630633938316566343434633734613561
39363531383233666437373562663136303834373838383632356436643638306633346434316362
63343866353465396630383562306230313737353863363935346630396134393534353531336535
65366634316230323264366662376133303565626638386635616536303839363737663538353338
32663834636363643034316165303164386430346663303635323634373465326537653132366230
38376361663233646266663330363236666533663861303365303833386465653864656331616162
66323532643737643539643562653335393338643465373838656464326133393466373733343666
39613331376538653934333061376664323230636663336232333361623136393836326262336430
35663930336364376230356537326131323666343330373030303765653763323863646631666136
39623936613762393332303763633966303966396536643236366534316539386136633230653433
65326634323062313730376338343965386338306135393033333161313839333963326134653966
66363365353537323034646537633331336134363239393465363164663263313731666335613032
61643935623064626464346430353033313961326164316637316664363830633137383335316538
31646133623461386434343663313365376230613237326638393464366166633635646462373939
31313165616363373730393733386430633065373433643935643931363965393465323264626164
65333431653566646134646132626136323035323362313163303463393962306631363631383762
63333063633934646332303966666461663566626564643365643232323732646530303834616639
63616262316563636636613764663563323063636331643063373364373337373664333763363464
31346663633866653162323934613532333934626430643138613631653164343063323661383163
36633431376463633334306663346462373166613531663064323238323434346439333936313539
33663036663234383934626661383530666566323336363734336265346235306135336136373864
38313937663965313334653139366430316632313737303639636135666235346633303861626430
34373938633331666535336438313363626636363063333265316166333562616330306563386335
65366366303937376438313032643037656465393263393434623462336430393031373433383532
66306566656437323530323434353835303838303438613662356134343136386630643338333264
30643039666535323736303930336239643730653233393538633235303938623161343437616136
34613337383363656536373737396261396261653264373362313161336435623466366436623736
61313036383063656537613664633437336361396665633764313062396265323766346363656666
33656130316566633563353631323438343532393563633830343131653063353331323961343636
38303239623566383337356262313538316437323731326166366139623665356132313563663734
34353065316164653638313439303466316338373565323435343937653632313566656438333730
62373366333335643366356438613838373963363436393035623132626233373830666238323464
33356562636261376665303262633665323830316137306239626432323330393863613938313539
33613438373733633661633266353866373834346436383466636138393736373638623136383639
38653439373230353265386166663562633738306232623132636333396135343461646136303162
36343636306333376564383764356433653362356434306566376565653736643035336433303331
38626430623633313336653261633834323430323137313533333166393966633662613561643863
65653237636436373739633862313132623831623461643063626361613231343537383032346132
61383666383134373061643061656164366364656231343434616366356237303766343166613964
36376461366663373132326263616263316663323039626239643361363362306334633636343064
66336533626562323832633133653366323137616431363566653561363233626239616262346165
30396466343639383665383762383765396638323761653065356339343965373032306136656563
31353033343532366339303331366235373838356461353564623430333561356635336163396466
38303438616436383763386538663039393862636333326630623862353732343961646162653933
35633235303530353065343434333164306530363839663366316235333563663965623934383634
32616565313232373964366163323739353261643432363037666639663664303861383033333462
62333633626263393637306365353565306636386238613365643537353861396638643065616236
63303130313363326333663936393765623930636331663837313835333862386263303238386262
35646634663163626438356536346239666461306462326465613339653337326436356638323666
38323134396238356532623430303233303636343839646436363066383136366436336536313766
33373036386465623737316435643430616434336165343832386539666432613365326664663237
61333166343438313131643635663234626638623139363034616263643463356632353932383938
61383065343231633438313536633039633266323563336531663365326137666535623230336134
34646661306330653631383364343566386531313137643233376265313461396538373132396366
66313534386133346161373130386465383139623831653566326434646461306139633433656630
64623164376361643062396139356464373131653036336361623738633263326234323066613661
31306163313038333861656561356661383436363534366665376362346661616464633065303234
61616237313434363761636261313630356639346434636465363763373235636462666338343265
34336533376366393339306539633238326663656266373965623962623665626238366333393734
35646636666535396638373134376362396134353035633566336461326630323833383734356161
62303738343662633735663965336435316630653061373736643035653337363635623863626533
31306138313839616131363333326439323863646236613133333163366162353063366561656631
61623237633361313631633463666335643935616237656134383830393335346632393066666632
66326331653430633165333037316637303138353133313264643739626566353137383265366264
38353533613863353431656665363339633265303463613565636565393836616230643932333762
30353437343761613236613431626536666538336234633166623961363031393235333763626337
65623836323538653730393533383532626133393834376339303630626533613339623666353839
38613833623830306566333035336334383733626166363239356661353965353462393161626136
37336365663863393963653031303337396666653262646635386337386230383562616564653966
34393831383639303562333464653736363330326462623266383038326561323264363563623065
30366435323961613463653636666238383632353661326439346430356134643866396531623039
66663830353732663863393762626161383263663535333032393632633066363836363939316262
30373766363637316535306538663235656137363038623936366465376636393535326437666334
30343437326362613761376262383265313264383464383838386638653065313864353235373331
62646366333137643931316339373761663731633766363864633461323266663236613231656633
31653132343031313535656538663761386266333062646439383633336531373764366166646165
64343439386336323064616634363532353166353531633332663862653666666436666564356236
62336332386437626137386566333934393636313933386466366361633232383135383066396263
38343432323865353563363631646535633438336333316134343862336666313063643036343030
62323732353837363639376564336665343265663861303938316564646533346337306338623834
62353835356465303561346337366136396664383961663237653538643462666263346638303363
32663564646333343532613861336132396530363435626361643631666464383364613336383235
64376465636238633765643234383665663637643565626663393066316538313563393730396430
36373037396264613731353337393261346534343263393862376464393565353739393431313031
61353538366439383234316530326338633635393035376335616565356630633964636639386639
63356666653532666435663564393332303234363465636335316365326365633837663930616233
61343933653232666138613866666430376439396336353535663361373564366262646663653064
31353765386537656235613131323763323930363162646236333632663034356237363231313762
39323531333264633863363163333735303636333866653763373362626265396265356564303533
31353838333337393732633961353561633430616637396235626261316433366339356239633737
64333636333566366237303231376337613539643464663839303438313532323538643738353866
38626438303033346531323836336534633732366631376665663139323037643161326561363635
34633237623537383466316433336636633962623161383338656339613139346138366132356365
38363635666234616532316333366236396639353130646234626533666133363661393038353666
38343530306239336234336463646332356462356565376463383930656561336239656465303231
61323862333032343137636434643335383163366236373161653366323139646235306564366637
31313335653732633434616436636532343037383861393931323734383964346437323933653737
39653633663064313933346231663931343163336166663662333239376634386135666230393563
34333163653935326532386662613537373161366331633737653539333161386461313638643034
62323433613164383731653534383662316364333538613433623731376234306538663766363965
64376432396361636637343539393330323835353562393031616137393363333662346332616464
32643939663266343038356539656464393665616637383030666630333834613830373837353738
63623130653465386135636635643637366231383765623761356563323061343337306538633031
66326334303539623763636362333534643431383962383539613964613531353135663463373266
37326632353861383964653430656362613930353138316566636531323733396231333361663431
66356561366634323832386437336130363535343132333436633761613731636561333039303965
33336532373764303334636461646464633866656237656466613361613131613764366339336233
38373030366130613230636365303233393631383538316230366434326137336532333261383236
64306566343964643139646438633066373261363836386361316138326362373361316536313839
39663633343330663732376230633638626533313963306266363030306431373862633833383532
36623537323532373934613962613761376463363337393666316434383463393962616366643436
34326566383666663266396165613534633464656130313535383963353238623238393837353133
66396661626432313038306362393136616166653962363736363133303835376264616561343736
38383531623733326366333661393262613335653238343235353165613339393535316236353563
35663037363935386634623064636333666135313361303837383630643665613863373931626333
36316138343462636538616466383461353639613264653831323133333262626633353766643730
63343030346536616539643832303238393539383362316137386437356630313438623436636465
35363436306634393764386362616330373732623763373064306562326337303732333733346563
63356231343165653132303338343439356666646162626639646232623064656664336133666233
36366366363264663033333731616632383438306435663631613439646466663434343931663764
36623437666232323336366363333333373430303639393761636463333135626263333066656538
35336431623265663239633963353162366534653864653530623935333137653761336234616133
61643231663033393535383063373236363538623964303435623337383031653734626461623731
62306565303739313166333663363935313362356362303066323635626638393961623138613864
33626639323030306461326232323533303131633630316437333936653839626362613162336339
39373339626238303238306363356166646532623963306438626264633961643765353434326430
65323535306566343537663632393866616239613732643032356536303764636564306630383633
66356435616237376538653539366636636533343866623764316462346634313032333636336166
33653231336563363336303936336430343137653966393530393532323563393532353434393231
38363662613161626132383266323635613165363433623630653663396562366262376634326561
66643938306331663931386535613833613761313639363038616139343966656662646432663666
63393931373738373536323631353361303366343330306565393230396332373932303866333034
35396166633165396537373638333730303730613939386663653032626439363466623231303833
63656338656435383531613734643165613536353632393535646132303034663731396631303237
64376438373538373362353766303963396639333732373266343766363534623063313138616139
39313861616164613031643934313466633431316230656566306666303932343039383737313565
66356432336663636631666138636538323238303462376330663134616365323536386234666136
63343032383465616437303437303063626335363333656166393435343834646634313435653334
31366465386238393133366364376565656639656230343161613463393931373537383564353866
31313464663531353165646665356231646634383936643539323866376631666635306334616261
39383439366664386563386133356239333133306162316466343334356631616434623363643535
38663530623063373965666530386632323034623139303839323761376638313362316430373536
62363265366537656237633663663266653631653561303965616635363438613061306362336430
35303461633864353735613330643966396230623434323132383135623331353361633134663931
33333435306635313161613930656239346461623931356430306364383937353433626435633832
64613437313464323861356338643733386432656233663333343437353935353236346561366330
32396465333833343732653136616636663736623434363765336161383433356333313135313161
33373764393265376661613465626638353636653931323162363031666262653062626166363930
39613931356338393862356537343332633635366134343037633765616634316362386335663036
32666465323538356634346662383238326663333339623430376362306534363630613337626266
39326361383435623939663163373835626439643433393839383730666166666266356361633731
33336265613531303735613239316362633538386632343836613230326164366165616265313066
35333361303734343231633930346230343432336665383337343431303031383962383366343433
63363364333063313632663765633831323863626636643862323865356461366361343563383363
33363138646366333136326435376537356338633862623531393938373935353466376266333664
31633039336362363237376266346561313064393537613832663130653761636633313562316639
36633432613931663263343861396632356136366636336163343333323661666663346365626564
32613734313663656164333537653666313033643262336239623961313638306634343666303938
62636236353161336134323430336263643038623663353965656236623465326661633766363765
35653261663335313065383266383833393431333631653363363030363939323862653262316637
62343263623037643435656165623466326365363532353434643665336632383765313937666535
37663463303034363531386465383663393534393435633764646138313962373735393334326137
61653933316435363130333335323066386532626234626534396435383061333961363739333033
61656364313963303132623837666463633066653165316633373166373161343539393132316665
37646631643265333665643262666265653339616530336361333333633939373839323264613761
62643363356431306330313761623933623333383066333364663439646536333232386232623238
62356533636632396330353430653935613965383938643638353632643865323832623737646635
32636464343734653765396236653538343463373662653733326362363330643038663766383861
34316338343064393862353364613037393231343366633364393535343965623431

5
group_vars/bdd.yml Normal file
View file

@ -0,0 +1,5 @@
---
borg_keep_hourly: 6
borg_backup_exclude:
- "/var/lib/postgresql/"
...

View file

@ -0,0 +1,12 @@
---
borg_keep_hourly: 6
borg_keep_daily: 7
borg_keep_weekly: 4
borg_keep_monthly: 12
borg_backup_directories:
- "/etc"
- "/var"
- "/data_nextcloud"
- "/data_gitea"
- "/data_mail"
...

View file

@ -1,4 +1,9 @@
---
borg_backup_directories:
- "/etc/"
- "/var/"
borg_backup_exclude: []
rsyslog_collector_base_dir: /var/log/remote
rsyslog_inputs:
- proto: relp

View file

@ -0,0 +1,3 @@
---
borg_server_backups_dir: /borg
...

View file

@ -0,0 +1 @@
postgresql_databases: true

6
hosts
View file

@ -29,7 +29,6 @@ stream.adm.auro.re
re2o-server.adm.auro.re
re2o-ldap.adm.auro.re
re2o-db.adm.auro.re
#services-bdd-local.adm.auro.re
backup.adm.auro.re
mail.adm.auro.re
wikijs.adm.auro.re
@ -39,6 +38,9 @@ jitsi-aurore.adm.auro.re
log.adm.auro.re
bdd.adm.auro.re
bdd-ovh.adm.auro.re
litl.adm.auro.re
services-bdd-local.adm.auro.re
log.adm.auro.re
[aurore_testing_vm]
pendragon.adm.auro.re
@ -514,3 +516,5 @@ proxy.adm.auro.re
[bdd]
bdd.adm.auro.re
bdd-ovh.adm.auro.re
services-bdd-local.adm.auro.re
re2o-bdd.adm.auro.re

View file

@ -0,0 +1,8 @@
---
borg_keep_hourly: 0
borg_keep_daily: 0
borg_keep_weekly: 0
borg_keep_monthly: 0
borg_server_user: borgbackup
borg_server_group: borgbackup
...

View file

@ -0,0 +1,5 @@
---
- name: Run systemd daemon-reload
systemd:
daemon_reload: true
...

View file

@ -0,0 +1,133 @@
---
- name: Pin borgmatic
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: root
group: root
mode: u=rw,g=r,o=
loop:
- src: apt/list.j2
dest: /etc/apt/sources.list.d/bullseye.list
- src: apt/preferences.j2
dest: /etc/apt/preferences.d/borgmatic-bullseye
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version | int <= 10
- name: Don't pin borgmatic if we are on bullseye
file:
path: "/etc/apt/{{ item }}"
state: absent
loop:
- sources.list.d/bullseye.list
- preferences.d/borgmatic-bullseye
when:
- ansible_distribution == "Debian"
- ansible_distribution_release == "bullseye"
- name: Install borgmatic
apt:
name: borgmatic
update_cache: true
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Create configuration directory for borgmatic
file:
path: /etc/borgmatic
state: directory
owner: root
group: root
mode: u=rwx,g=rx,o=
- name: Add borgmatic configuration file
become: true
template:
src: config.yaml.j2
dest: /etc/borgmatic/config.yaml
owner: root
group: root
mode: u=rw,g=r,o=
vars:
borg_host_dir: "/borg/{{ inventory_hostname }}"
- name: Create SSH key
openssh_keypair:
path: "/etc/borgmatic/id_remote"
type: ed25519
regenerate: full_idempotence
owner: root
group: root
mode: u=rw,g=,o=
register: ssh_key
- name: Gather SSH host keys
delegate_to: "{{ borg_server_host }}"
command: "ssh-keyscan {{ borg_server_host }}"
register: keys
- name: Add server key to known hosts
known_hosts:
hash_host: true
host: "{{ borg_server_host }}"
key: "{{ item }}"
loop: "{{ keys.stdout_lines }}"
- name: Add public key to remote
delegate_to: "{{ borg_server_host }}"
become: true
authorized_key:
exclusive: false
user: "{{ borg_server_user }}"
key: "{{ ssh_key.public_key }}"
key_options: "{{ options | join(',') }}"
vars:
borg_host_dir: "/borg/{{ inventory_hostname }}"
options:
- 'command="borg serve --restrict-to-path {{ borg_host_dir }}"'
- no-agent-forwarding
- no-port-forwarding
- no-pty
- no-user-rc
- no-X11-forwarding
- name: Init repository
command: borgmatic init --encryption repokey
- name: Install timer and service for borgmatic
template:
src: "{{ item }}.j2"
dest: "/etc/systemd/system/{{ item }}"
owner: root
group: root
mode: u=rw,g=r,o=
loop:
- borgmatic.timer
- borgmatic.service
notify:
- Run systemd daemon-reload
- name: Run systemd deamon-reload
systemd:
daemon_reload: true
- name: Start and enable borgmatic timer
systemd:
name: borgmatic.timer
state: started
enabled: true
- name: Start and enable borgmatic service
systemd:
name: borgmatic.service
state: started
enabled: true
- include_role:
name: update_motd
vars:
key: 10-borgmatic
message: Borgmatic (client) est installé dans /etc/borgmatic/config.yaml.
...

View file

@ -0,0 +1,3 @@
{{ ansible_managed | comment }}
deb https://deb.debian.org/debian/ bullseye main

View file

@ -0,0 +1,9 @@
{{ ansible_managed | comment }}
Package: *
Pin: release n=bullseye
Pin-Priority: 1
Package: borgmatic
Pin: release n=bullseye
Pin-Priority: 900

View file

@ -0,0 +1,29 @@
{{ ansible_managed | comment }}
[Unit]
Description=Service for borgmatic backup
Wants=network-online.target
After=network-online.target
ConditionACPower=true
[Service]
Type=simple
ProtectSystem=full
CapabilityBoundingSet=CAP_DAC_READ_SEARCH CAP_NET_RAW
# Lower CPU and I/O priority.
Nice=19
CPUSchedulingPolicy=batch
IOSchedulingClass=best-effort
IOSchedulingPriority=7
IOWeight=100
Restart=no
# Prevent rate limiting of borgmatic log events. If you are using an older version of systemd that
# doesn't support this (pre-240 or so), you may have to remove this option.
LogRateLimitIntervalSec=0
# Delay start to prevent backups running during boot. Note that systemd-inhibit requires dbus and
# dbus-user-session to be installed.
# ExecStartPre=sleep 1m
ExecStart=systemd-inhibit --who="borgmatic" --why="Prevent interrupting scheduled backup" /usr/bin/borgmatic -v 1

View file

@ -0,0 +1,10 @@
{{ ansible_managed | comment }}
[Unit]
Description=Timer for borgmatic backup
[Timer]
OnCalendar=daily
[Install]
WantedBy=timers.target

View file

@ -0,0 +1,51 @@
---
{{ ansible_managed | comment }}
location:
source_directories:
{% for source in borg_backup_directories %}
- {{ source }}
{% endfor %}
exclude_patterns:
{% for exclude in borg_backup_exclude %}
- {{ exclude }}
{% endfor %}
repositories:
- {{ borg_server_user }}@{{ borg_server_host }}:{{ borg_host_dir }}
borgmatic_source_directory: /var/backups
storage:
encryption_passphrase: "{{ borg_encryption_passphrase }}"
ssh_command: ssh -i /etc/borgmatic/id_remote
# compression: 'lz4'
# umask: 0077
# lock_wait: 5
# archive_name_format: '{hostname}-{now}'
retention:
{% if borg_keep_hourly > 0 %}
keep_hourly: {{ borg_keep_hourly }}
{% endif %}
{% if borg_keep_daily > 0 %}
keep_daily: {{ borg_keep_daily }}
{% endif %}
{% if borg_keep_weekly > 0 %}
keep_weekly: {{ borg_keep_weekly }}
{% endif %}
{% if borg_keep_monthly > 0 %}
keep_monthly: {{ borg_keep_monthly }}
{% endif %}
consistency:
checks:
- repository
- archives
{% if postgresql_databases is defined %}
hooks:
postgresql_databases:
- name: all
username: postgres
{% endif %}
...

View file

@ -0,0 +1,5 @@
---
borg_server_user: borgbackup
borg_server_group: borgbackup
borg_home_dir: /var/lib/borgbackup
...

View file

@ -0,0 +1,47 @@
---
- name: Install borg
apt:
name: borgbackup
state: present
update_cache: true
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Create a local group for borg
become: true
group:
name: "{{ borg_server_group }}"
system: true
- name: Create a local user for borg
become: true
user:
home: "{{ borg_home_dir }}"
create_home: true
comment: Local user for borgbackup server
name: "{{ borg_server_user }}"
group: "{{ borg_server_group }}"
system: true
# Does not constitute a valid hash, preventing from login via password
password: "*"
update_password: always
- name: Create backup directory
become: true
file:
path: "{{ borg_server_backups_dir }}"
state: directory
owner: "{{ borg_server_user }}"
group: "{{ borg_server_group }}"
mode: u=rwx,g=,o=
- include_role:
name: update_motd
vars:
motd_messages:
- key: 10-borg-server
message: >-
Les sauvegardes (borg) sont stockées dans
{{ borg_server_backups_dir }}.
...

View file

@ -2,7 +2,7 @@
- name: Remove cached motd
become: true
file:
path: "{{ item }}"
path: "{{ item }}"
state: absent
loop:
- /var/run/motd.dynamic