summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gitservers.yaml1
-rw-r--r--host_vars/git-test.nowhere.ws99
-rw-r--r--host_vars/wolpertinger.nowhere.ws200
-rw-r--r--roles/apache/tasks/ssl.yaml21
-rw-r--r--roles/cgit/defaults/main.yaml2
-rw-r--r--roles/cgit/files/cgit-assets/git.css2
-rw-r--r--roles/cgit/files/cgit-assets/highlight.css19
-rw-r--r--roles/cgit/files/cgit-assets/logo.pngbin0 -> 3224 bytes
-rw-r--r--roles/cgit/files/cgit.source.filter9
-rw-r--r--roles/cgit/meta/main.yaml3
-rw-r--r--roles/cgit/tasks/main.yaml70
-rw-r--r--roles/cgit/templates/cgitrc.j28
-rw-r--r--roles/cgit/templates/repocreate-plain.conf.j21
-rw-r--r--roles/cgit/templates/repocreate-ssl.conf.j218
-rw-r--r--roles/cgit/templates/server.conf.j219
-rw-r--r--roles/cgit/templates/ssl.conf.j220
-rw-r--r--roles/cgit/templates/vhost.conf.j29
-rw-r--r--roles/sublab_web/defaults/main.yaml2
-rw-r--r--roles/sublab_web/tasks/main.yaml23
-rw-r--r--ssl/git-test.nowhere.ws/cert.pem22
-rw-r--r--ssl/git-test.nowhere.ws/chain.pem22
-rw-r--r--ssl/wolpertinger.nowhere.ws/cert.pem (renamed from roles/sublab_web/files/ssl/wolpertinger.nowhere.ws/cert.pem)0
-rw-r--r--ssl/wolpertinger.nowhere.ws/chain.pem (renamed from roles/sublab_web/files/ssl/wolpertinger.nowhere.ws/chain.pem)0
23 files changed, 448 insertions, 122 deletions
diff --git a/gitservers.yaml b/gitservers.yaml
index 3d0e17f..ad7c2f1 100644
--- a/gitservers.yaml
+++ b/gitservers.yaml
@@ -1,3 +1,4 @@
- hosts: gitservers
roles:
- common
+ - cgit
diff --git a/host_vars/git-test.nowhere.ws b/host_vars/git-test.nowhere.ws
new file mode 100644
index 0000000..83a26f8
--- /dev/null
+++ b/host_vars/git-test.nowhere.ws
@@ -0,0 +1,99 @@
+$ANSIBLE_VAULT;1.1;AES256
+39623039323837343466613866313162643336313132323938353064366539353838363465626432
+3030356639633663353135333466313235653636356263390a636133313831386136666135313932
+65663163353965663238643564313061306435333263363136633832396231306134653463366538
+3363363162303162300a613637326431666139373836303439376238656132336632333133393830
+63636539376566353037383665303531643463653439396163343535633939356430333065636530
+62313132616463303735383730383833666237373631343565623432396639363733313166656535
+36363536343935346330336164343065313730633634393065343132663561343535346333373165
+34353765353634306239636636316361343737333263323665306164353263356335643837353064
+63643563666363356261656333626233313536623761633630326634363965613533363566353334
+33663937303832613931666438643764663838663965383537323862306431666361663935366132
+66336535636132653966353130376334316339366133643637666234396233363966333533653938
+65616361666438353031383730376161316530656535343962336530373666653063663439366331
+61313165303736653734373065326138346535623063383135646332303135356336333839393238
+33353831306435393632386563393739646437336362376465336564333730396261363935363462
+35636462343638393831663436633165656332613661626665663861326438353965353265303534
+30363061336135343864383261623831626336636434306134366437343634623638656439646336
+36653335303830663039323730313262623161303436343861326230643835616536373233323966
+66376135366362366237376230383737396433643636633966346361613262353361383865363237
+35383264333136653532343165636331333438656134613466333939633866663233656537376234
+38316330386638666332653136303437613666666534343063616634613165633437663137613234
+31623435393761373765643231623366336462316334363365306636643533623635626631616436
+31616138323732303038346530326530656265393062313436373134393462303834353863353137
+39323536353963623831633234353431303035333330656137363861376166393666613235386639
+39396166346331386535393361626137653139396430323238633562366632366331333335623966
+34666432333534333833623539643537623562373262316162343530613737646161643962336436
+38396166353439383736323939636534333930346437343064303333326136326435346632636533
+34343037393037363831366230306336623135303930353138626238386365636562623931616139
+63376537363131366636386564653763386333333764373162393337393065663266353939353363
+39633830643636633538633634363861373835616331383936393835323866633261343137303830
+61623461626334623563663237616666356431303332336236646665616363393566343963663764
+38363662306531323864363766323735623234633037353135303032353966643538653536633839
+30326131303637623334653630343665643233656364643464666433613238383439613939306530
+63353838303534393363633931333063373036376466656462613764353636636232306330613561
+30343435366131666665303732663931366336353636376665386433623662656462316638623530
+62663462353733383438323037326331336561623565353237313837636435316231353766653234
+39646563323463663839636231653063323637656130393330383734396432663232343263343765
+33373638396262393961393065313661663531333838393463366535626662386235393436623063
+32613333306439323866366431636231663165653237653930393561386232386666346661613630
+39303962636635326661356431373131633633356139303337356439633830646666313234346137
+62353766353132656466343939616165326166663535396236323265356432353739333833626535
+35343638636234633435356331346632396566366433623965346561333661353066633131353766
+39333435653764643732363661303063313536363038306437623865313166653862316333386432
+31343362643262623837396265613930303131633864316365633863376466383262346437363134
+30636331643566373033623063393761373562633937346166323266393363616464323661313730
+36663631613331386235363365626461326637646266356639663965663932396635616634643735
+34623939613631653333643165393564653939333264653739363636366166383265663437613136
+62633363623635656365616461363831393361626139316365326436636133633237616134323865
+38303631636630326631363665316331396631313239646363373936303233363532363762656337
+61613431626662653838353437633136346232333666626534663630376462373165313835323366
+34363164353063376631373263353162306161643938613261363761376330346261653365373366
+62306536393861393837306462313864396334393063323461666437373539333131613365623734
+63383339313564303337663365613330623163306135663939343733633134633665313039323533
+63636264316463306162383561646636346663396332383439303738336531383231383564343038
+65356236626432363939303238643762356635353636343766666635663437396334393862363636
+33616661363036323265303532373131396334356165353937613339313332363734623636343534
+64613431383233323931646337356633386331373135396363346233386566366236326236356134
+61333136333839343162306437343663336236336532336638623461383430346131643061396134
+62666562323531303161646261653030346339353236623564626666356430333137383733316664
+37303661386636656532663036313539323765376335326236366631646430613533356334356339
+66356332613438643438643261316136383736363364626235623335346430356565636337666439
+32663538666363333037623235363939653665383331353036626233343664643762656432366235
+39613431393332386630373564393265663563333438353034656536653134336161333031626163
+61313063616366343137323430376561356132303338656166653437373565313931633530336364
+30323434386238663665633534396664383861323763376461333165663336343961366235363631
+33323861343862363062346130393933306666633935353137323363363765396464393639346437
+36393662356631373461396661663136633836383534333366373137653964326335353235333964
+35316638316162633635626534623432343639343562616533333136626635336239656230343135
+39363633623833636466323564623564393237386635373762626263313432376332613138313564
+36313066656366313536366531623538653839326432336664306165376236356362643038333130
+37386235393631356237363437326364666561316132366134373539366261376630623962376664
+34353339643531353133366631303461663936626533343335633031363363313863336565303061
+62346337303365363364636264623761363134646430366537383734353736613265623235383330
+63656235363533393236336461613066313664333131613636663834363337333766386265626563
+65663963626438343930303334636536373633376564623435356635346632333334613039313765
+35393333326233363265313435363262623163386666356437316234333430643238303137346461
+33316638303361363332336665636363633463626166356361333833336465643337326366386639
+35376662393932633034393135356566646564336631393035643166303961356230386536373638
+61306232323464346264363763353766343363626461366634626134363563666633373833353938
+66323632366665376539326434616638323035656462366463346264636162386235336665343833
+64643164613964633333623665373738326461643735616531396134393462316432323136333739
+61313637616338663263316564353435343261653461316162326264646534393664313861323964
+38336363336131376436633861376335643863636661366136633132306330323339636233643061
+66366337653830623965313532623365656166343931393661643961306561613366323761613963
+64333732633237336331343238613331333035623866323465613738646433363833336334616437
+33666364663333636135396537396434643430326138626265326363373262386462323432643935
+35616632666231326234393235633661636436613462373962303834633831626139336532356563
+33366335376336373265626561366261636131613638323637386437306333663132326134333433
+36393137376234666462643735656234366164646635376565316535366534623632306130333261
+39623165383561376332313237366566613433616562353536303834373238633565623031303037
+34366435616632346238326261303639383766383337626235613332636633306639663932656561
+65343632323761383362313163653332336466316365616666653736386135613438666632653462
+65323138356134663232393538353438643433356332333931616562636563396135306334666136
+31636561313934316138313763376331373734343839666432363065393931323038386464393235
+31613362326165313333306564346636313963306238326565643766613964396636323466376134
+63393064323666663562613533306237326232343263633231313935663636646331376635636532
+63303434396233656633363462393437663237653931343466633434383033333765636435623765
+34386162303832636238323361316633626439666338323132356238383066333537393364383733
+6339383236346161643833323135613264646136363963383265
diff --git a/host_vars/wolpertinger.nowhere.ws b/host_vars/wolpertinger.nowhere.ws
index bc93e28..504ec24 100644
--- a/host_vars/wolpertinger.nowhere.ws
+++ b/host_vars/wolpertinger.nowhere.ws
@@ -1,102 +1,100 @@
$ANSIBLE_VAULT;1.1;AES256
-34383633393162356132376164666431383539346464333039633436343137313638616539386237
-6435353532373262363561663036333163326635373232340a363939343962346437646630316437
-66383931306438336633333065366662376234653537653138643933623966333863666465616365
-6564636632343835360a363531613738356332626461613161316236346263353231626563343965
-65336662323766333262343065623865353161386131656436666230366565613632383438663266
-64383233323430663864306639623561663236383066366235666466666638663436373238626330
-62646265373062353337666439313434386465653333346231303430383265323266353233626639
-63346331626638303639623163653637366164333138323939396664623939373364323530303432
-38313732316233393861626632303438343933343137343932626637333664366333363762316361
-61636463643761386537653034363863643936306163343737316532643232373165366266393864
-64316563303663373265343534326461393933356437326638653862343665336562653565363961
-63366131653735626238366362623062633631336632373334653838353061386361346166666361
-66383130313931623664643562633465353833643631616262323730616436636361623135393662
-36356339616432626465306661316366623835356361666237383462343137346338623663396265
-38363462363766316434626561623265323664643232366638663038656530376433653333353232
-38393535373263613732313334386339663436616665626136646136646130383664613464656664
-64376138643139383534383732343030613632316337626338313366373933396537666636623565
-64653632626462366630656632373730633033303364363531346633653565393066333961666536
-32353230626163623765356339653530623037616637623864353235646231656462363930356263
-64323263383230343161353861333665633538316239616630366438313365616137303735633637
-37323464666438666162323236373463313034633732323064343032386332613432323836643361
-35333430333939616366393865313732626137333330343233343233383938616535656334393865
-30646430356630373933353263366565663035613634666162323830336265393136353661383336
-33633136633339336536313561363766343264316431653832333166653434653539633962393764
-30383762643339633363393230663762306431333435613332393666613939646437356237353331
-38623461393238303837313735393533663031346639393932363937323465393432663233313064
-35393930653161316137306138333537393034663330656563653361303535663134353532313333
-35303530623932366139366232643562303164376537616433666566363661383831353930373933
-65386662343365376464323763656264653661313862643666656162323966313564663833316431
-30346665653138653037613133336565636438633762653835353235636462613338326635356266
-61366638363538643764663865376436343335646237316135343637383034363237353336363465
-62653733653032356566323261396337363739633934663032663631326562373331366132383336
-66646536363061323736653737383431306635666633363632663732373161303430376138366238
-63353362393661336161306134386338373831306330343230623339303238393131663431356638
-64396238663237383235313734356262386461626134306532366666326466643436383839643534
-34323162643065666263613633363863393934393062353861393964343064663433383066653062
-63376465313663653266666437396566643964336431396665316134343866343036393338646233
-30303164373631363335336535363339393630396239633134663766333932326332343961363835
-36333666633666383838386562633133376362353266616135386335373965383131663231373536
-38643266373236343738343430356630383231396163383337363063653237373635613063333536
-63623235613539653362316635616530393030353130636535636631366339623932616662323230
-62393934643639643431376535323163613737653661303861656235393236313733636230343032
-66336563313638323166323566313764396662613766653635643031353037316539636564343966
-33343834646335316234636563363666613764316139326439313430343462616166343136366335
-63356630303036313762343962343764663134653535643463323232316364376332326434626538
-66323261363832396332613063363466656335623665396335373737376431336533383561316432
-30343332326537316336666162646532356535316566343333663463663939633238623763353533
-30386430653839343362363066643161313632376336356465653831656634303634646431383930
-66303430616534636138303236373265616131323230306330633261663739326633623136336164
-64613134356366663232356630633431623436353461333966623434323533633439646131323131
-65393333656436623233303866316164393365346261646335306566316365613936623535636461
-33353836323634376631646562336362376539373434643236363639303133343666623634303437
-38303233656264373965313739373038316138616564363037653131393765373231376336663463
-39656434646331356261633734313435306563396430373764643330616130653231646463393632
-31636630383062643563663264316535346364393361616336303132326162663032633630656534
-37623538623536306661343737363733356131343165303163653732383833643039366163613165
-30326331646363383135376464623762666233633930353662616166393638346436616433313038
-38373130353530303737356135623666313833353663343764343763663963346165343362626237
-39303737626461653339343836633561643363346435316634316166306135613464373733646261
-63646335353562393664323035373837653664643730636138323431393935343132356438346632
-64666563633534386139623335383965666662653036326239343639393262363466373865323235
-66303064663937393265396561336136653866383837356638333966393565373962376535383331
-33396266636530356464643231393462346431373339653838313066383363366565346366313838
-61653639303666356232636663366265373163653461336637363036633866346439376666323435
-64666631313537633966623431323732386334313864393038303864343964306130306233323131
-31353466643161396138623739356537643664663861313565373035363230303863663230616433
-62333434373130626463633436643733333731353636356332366631666466623237343338353861
-61623664323439383663626632653730643161306236316535393932303039336633383131313035
-33373830313264356236363463336131383935633562633363363861326665323362373635613363
-63396635336665656438323165623263643031656537396434633335353933306338383265313336
-38313335653961636165633832356336613734316164613036326231636364373563356161613937
-30383162376131366265323662373832653462356139303235373262386535363265303164613935
-30353830613231633832376134333038383034303637343034653338343638653231646633316339
-35616530663733666338303134323362306631356633343631396130393836353564366665616666
-65303261393832336533373839646531623966376263613765633466663266666436636161353464
-39346639376630396137353430393561303535366566643633333761346436643431373932373865
-34663661336332336432623931623663613266326663663731656532383533336661626662376165
-63646437303933636361386564633030306137653264346637393062383132333965386165323535
-31343366323736633038356562613863373334396264323765393765626264623066336531626234
-35613435323133383537666632623837323565303335346433366663316565316264396535666166
-63343162373235656533373663666462356236363136316566363361653735373736623262306134
-37363637373230373266303234666461653566376135666138646530353139313064613062316338
-66333337333938393539353138643266613835323838343636636661616239363563306330343835
-38303261396662393164383262633435663031663531616665353266373034366332616265343064
-64346632306165366633303934383338633334306264303963363761393565633634353561383931
-62396432363463616537636364666334336461343363323034343163623736343839306237306364
-66396331313731373261623835313163613135326433623031326237636337633433323735646464
-30323566343137336138613665636666326463336431663434393366633965376133653336326632
-36393438386665373461646165323239313163616637333032633338663333343338373330313139
-37643937346262373730316630393063313433623036666437663537316338623136363039323431
-30383038336234663935303533386361353031306661656564326134646665636332356463663930
-39663737636539643739663362346230363061663535323138376632363437633536306335316234
-32366365646230623734616536353437366164656533316136653565393736646361373065613364
-65373461363164376637303564333339303137623264663234383939313335333466336265663139
-31643330333661396536613435653661663937383130396530626661613930306638646639373566
-61636461346336356239653666376461396532383534323033623431376133623265656266393932
-34376637353730633037323066316364616564353737643233383264353739393335363431616331
-35633166306439396235356165386265373461363766353336396266613039633837363039626664
-38643435366133373230626262633362303038343233643630343562316637333161343938666539
-65386232386463323833626538356633633662303965656335626431366430396562383537633665
-6436
+35343062663335326561333736383333303230356435316530643832326230383036336565323437
+6137343938316234366365646530636438653363353437300a303632366438323532353634363165
+39663361656539646333316238343335623238343462623838666439323338316430646363366163
+6536616436636563340a393265313563396334326333366562393964396364633465343937353731
+37373665393965363938383165313030616462393336376166383635663162333063646262623034
+38633935343530646631633332646433333338666463656638326462346138386534306666623666
+33376632646464653833336563326134393534333863666665353561393530353135623165633762
+31396162613439323962306435316663313531396232333730623732333963316466323635623632
+39613432626336353165363437646461333236346434383437613063613766666362626235653839
+65653138323764336361316335623265663865636630333461353765376365613139633330666234
+63386337653936616232653139343535363134653365613633343039373034663238613264663063
+32666438383830393666323263356233643863643866393935343164633362363630343736316436
+38616164393530623362366634353633316533333837363534373234666333336666643933393636
+39663564323739383064323931336530323563636333353038646461616633653632303139313438
+63333337343532346536333637613136363431373434303764383835626561613735326364303732
+65623931323064653764306565646665313766313666663337616566326231666166663434333331
+33656639643337383334316662633136326637363964653862626235303935623238636633646365
+39346664623436663561633234626233396136353966343864306337396233303137616439366534
+61333438313636346239316339333630636436303236653433373662313633313932396630616638
+64656136323131353765333037323064376230326239366261636330383163376331623835393838
+64646264633138623034646464336265393537343733366561306235316130663332653533636164
+37303432376262663166373939343862393338326330353432323930303466383639333638633562
+66626331613537393833626365663435636366316562363437613132623364336531613235303531
+66316630366530316335373130363561376564643139363961306132643935386230656331336139
+37656661653137346635643663613332613232636637323436616365326435616662643735666561
+66353466623538323264336262356564656438376462633032653437323666623530383633323339
+65636432383564376533386637643761613639353332373136376235306633383336363666666633
+61343735303533643431623064306339383363663334393966636363353162653735316339616566
+38653831366564346233393038396661363830653933393037316662633338393663303533643331
+61313661343661336266356336386362343838666330336239643933313938353135653564393366
+32653439343465623864633065323137626666383836616666666463306663353866386534333136
+30323432393230346137373264626439336166373962623339333430386430326137646565643530
+66376531666333303534303031333965313633663132373931383239386534386261343761633134
+64643463646432666466386464346534633437353037633637643039663438383262306264373632
+32636462656130393437643861306534313761356631333234636534653134323331353238383738
+37643632313465656466353531333839643533613633643734396231656632353465316336656235
+38643134613739626138333738333738363933346234356131633532303632613464363432326364
+66633861616534383263393537316665616461363536633238633663383937363034643436373234
+63306534636638323165393566303531313936333332383063336632616464663734373961393066
+34666434363362626362383061303136383630653663643036623261316439623361333031326639
+31353331383138313935626337323436363531396336613638636630383033363536343934626431
+39303966656235396165326366313264656662663764326234313632616137303137343966656338
+62613235393164393436383938616633663832656538386435383037613032666632343032323636
+37303330653932643230626332666265363538306365323965623733323232333536353433363163
+32636235326266393434653565356436626161386164623135666232373739386239613066316237
+34663532383061343735313835626263336633333634373862356331643135306137643033313339
+38643466623332363139323932343266343437333466303562396366366631663363616564363939
+35633664666437643235393763663335353365366266633263303333346334346534633230646264
+36643361613236313361646161663261343364613634343565326138636235316633366164313937
+66643131646330363532386263623437366435633236383035323534343432363530336166313837
+63383036313862663837353363323365636261373161386137636563393135383435653365613835
+37363165353936303637356635323231323938303261393966353635623037363661633733343363
+61306630376636653830653331316632643531626637363864643331666363303136356436316532
+30346364663165633764303366306430363935306439313039613537653931333933626465363335
+35643162366266633837396331363037316465653732373132353331633638633232636437363737
+37356437376531666662333435663566613734386135303432376464353364393965356664613962
+65663663336136336131376632656163623737616237646663653338646339633731336137313336
+33663231376439663333616466306430616361356366616163343863366634393338323138323839
+35653436613437666230653665333064363130353632663830366436393364346561616334353866
+37386364313635653436333961393534653236393363653665666363333863303364393461356637
+37333064613134303031383937376464383135353332653266343731393234346334323338316334
+34333931323638363733636430363861366131393462313765396262663139383262636363306434
+37383065373732343738316465393235626465623862393435316334313236666262376239313231
+35356266393236323963316530326263363461656239613534363532383239646366323132303032
+38306462343530646465303266323966633363623533356466366133366661393935366530373766
+30613965656565636436346135376233386637626164323735633733333632323532633032646564
+36336165376461653964333936333336636164373832333534303934306435323736333333373365
+39313437633138386637336334366239323230636530656535323563333463343431623430613234
+65323134636339613430653136343137396134376234366466323733653336643065623533646431
+31353436336235306339373064343635343363656565646637613835366232646634313233356630
+38633166636330313934326239363264366230646661373965306332623165383433633064306332
+63326430323535323230313066363561633237623632343331623930633037343430393837623366
+38376131316637303733366635313539643961313564626162373261363631623130356435633834
+33346365333935313432393139653139306466616266613834646164653833393636663237313962
+32623135613031313363333238613064626234393232626334646135616331633263616437363266
+39613532646166306131363839613136356664653066363230353462633162626665333130393936
+63636134366463653734396363636635303861646466353839306137316232363531363836616231
+37326236636539646133323261643265656530333461306562343730383531656635393537353436
+33663938383961613562313135656637373038326430653163306563643065613137623638313432
+32343830346164616361363231656262646437333935303330303136396534613066303665653763
+37643034376332306561306233656363616463396665626266336538613531323361383262303230
+30323134653061323438626237666639633435336231663536653133656363303833306233653233
+38353039383137653765323338633738346465313561653861336335316535666137333334306433
+64653935343132646631323566633939353534653666383437666362643236656164633333616665
+61323439623035343231356535373833363133353138306562386161323330386565353761303336
+35303363653937636134633966306462646634326461666537353364396563303864336262326533
+31323565373437336633633634636663636131393230653964303565646231323132323535623237
+30363538643736633437383661303135363765643665383537353838303736383331383033333463
+65386264656365646639623030316535643961373831323732306263326461633363613131653766
+38363835636332306266323862353364316361613337383237353239376236343965373933303565
+30623937663730383833653863666637653462383235636632616363636362363162313461666461
+61346666623032366563366237343865313663663164326538373435633334333839326134663537
+38353536376434633231336235626461316263306234636461333133613831663265366231636435
+39306566633165336234626235306130646464613033326632333930373866353930346339653830
+37313331306230643561643232376337663930363135383630663863386131666135373535613831
+37303866343630393034373532373935613534386138366330353637306532303830303265373837
+65343763353764393465633530663933343331656164313831636638346662386636386436306564
+34353166313036336463336161333466313032323662306139653434636432356232666639663336
+363632313938623262643162636662336164
diff --git a/roles/apache/tasks/ssl.yaml b/roles/apache/tasks/ssl.yaml
new file mode 100644
index 0000000..979d364
--- /dev/null
+++ b/roles/apache/tasks/ssl.yaml
@@ -0,0 +1,21 @@
+---
+- name: Create ssl DIR
+ file:
+ path=/etc/apache2/sites/{{ ssl_server_name }}/ssl
+ state=directory
+
+- name: Place SSL cert and chain
+ copy:
+ src=ssl/{{ ssl_server_name }}/{{item}}
+ dest=/etc/apache2/sites/{{ ssl_server_name }}/ssl/{{item}}
+ with_items:
+ - cert.pem
+ - chain.pem
+ notify: Reload apache
+
+- name: Place SSL key
+ copy:
+ content="{{ssl_keys[ssl_server_name]}}"
+ dest="/etc/apache2/sites/{{ssl_server_name}}/ssl/key.pem"
+ mode=0600
+ notify: Reload apache
diff --git a/roles/cgit/defaults/main.yaml b/roles/cgit/defaults/main.yaml
new file mode 100644
index 0000000..28da704
--- /dev/null
+++ b/roles/cgit/defaults/main.yaml
@@ -0,0 +1,2 @@
+---
+git_server_name: "{{inventory_hostname}}"
diff --git a/roles/cgit/files/cgit-assets/git.css b/roles/cgit/files/cgit-assets/git.css
new file mode 100644
index 0000000..ed2ecd8
--- /dev/null
+++ b/roles/cgit/files/cgit-assets/git.css
@@ -0,0 +1,2 @@
+@import "cgit.css";
+@import "highlight.css";
diff --git a/roles/cgit/files/cgit-assets/highlight.css b/roles/cgit/files/cgit-assets/highlight.css
new file mode 100644
index 0000000..99af709
--- /dev/null
+++ b/roles/cgit/files/cgit-assets/highlight.css
@@ -0,0 +1,19 @@
+/* Style definition file generated by highlight 3.6, http://www.andre-simon.de/ */
+
+/* Highlighting theme: vim earendel */
+
+/* body.hl { background-color:#ffffff; } */
+pre.hl { color:#000000; background-color:#ffffff; font-size:10pt; font-family:'Courier New';}
+.hl.num { color:#a8660d; }
+.hl.esc { color:#a80d9e; }
+.hl.str { color:#a8660d; }
+.hl.pps { color:#a8660d; }
+.hl.slc { color:#558817; }
+.hl.com { color:#558817; }
+.hl.ppc { color:#0da818; }
+.hl.opt { color:#000000; }
+.hl.lin { color:#006666; }
+.hl.kwa { color:#2239a8; font-weight:bold; }
+.hl.kwb { color:#8c1d69; font-weight:bold; }
+.hl.kwc { color:#a89222; font-weight:bold; }
+.hl.kwd { color:#a8227b; }
diff --git a/roles/cgit/files/cgit-assets/logo.png b/roles/cgit/files/cgit-assets/logo.png
new file mode 100644
index 0000000..af1814f
--- /dev/null
+++ b/roles/cgit/files/cgit-assets/logo.png
Binary files differ
diff --git a/roles/cgit/files/cgit.source.filter b/roles/cgit/files/cgit.source.filter
new file mode 100644
index 0000000..f5c8e88
--- /dev/null
+++ b/roles/cgit/files/cgit.source.filter
@@ -0,0 +1,9 @@
+#!/bin/sh
+# store filename and extension in local vars
+BASENAME="$1"
+EXTENSION="${BASENAME##*.}"
+
+# map Makefile and Makefile.* to .mk
+[ "${BASENAME%%.*}" = "Makefile" ] && EXTENSION=mk
+
+exec highlight --force -f -S "$EXTENSION" 2>/tmp/cgit.filter
diff --git a/roles/cgit/meta/main.yaml b/roles/cgit/meta/main.yaml
new file mode 100644
index 0000000..0e24889
--- /dev/null
+++ b/roles/cgit/meta/main.yaml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - role: apache
diff --git a/roles/cgit/tasks/main.yaml b/roles/cgit/tasks/main.yaml
new file mode 100644
index 0000000..cc18696
--- /dev/null
+++ b/roles/cgit/tasks/main.yaml
@@ -0,0 +1,70 @@
+---
+- name: Install cgit package and depencies
+ apt: name={{item}} state=present
+ with_items:
+ - cgit
+ - highlight
+
+- name: Install cgit highlighting script
+ copy:
+ src=cgit.source.filter
+ dest=/etc/cgit.source.filter
+ mode=0755
+
+- name: Create cgit assets dir
+ file:
+ name=/var/www/{{ git_server_name }}/static
+ recurse=yes
+ state=directory
+
+- name: Put cgit assets
+ copy:
+ src="cgit-assets/{{item}}"
+ dest="/var/www/{{ git_server_name }}/static/{{item}}"
+ with_items:
+ - git.css
+ - highlight.css
+ - logo.png
+
+- name: Symlink cgit css
+ file:
+ name="/var/www/{{git_server_name}}/static/cgit.css"
+ state=link
+ src=../../../../usr/share/cgit/cgit.css
+
+- name: Symlink robots.txt
+ file:
+ name="/var/www/{{git_server_name}}/robots.txt"
+ state=link
+ src=../../../usr/share/cgit/robots.txt
+
+- name: Put cgit configuration
+ template:
+ src=cgitrc.j2
+ dest=/etc/cgitrc
+
+- name: Put apache config
+ template:
+ src=vhost.conf.j2
+ dest=/etc/apache2/sites-enabled/cgit.conf
+
+- name: Create config snippet dir
+ file:
+ name=/etc/apache2/sites/{{ git_server_name }}
+ recurse=yes
+ state=directory
+
+- name: Place config snippets
+ template:
+ dest=/etc/apache2/sites/{{ git_server_name }}/{{ item }}
+ src={{ item }}.j2
+ with_items:
+ - repocreate-plain.conf
+ - repocreate-ssl.conf
+ - server.conf
+ - ssl.conf
+ notify: Reload apache
+
+- include: ../../apache/tasks/ssl.yaml
+ vars:
+ ssl_server_name: "{{git_server_name}}"
diff --git a/roles/cgit/templates/cgitrc.j2 b/roles/cgit/templates/cgitrc.j2
new file mode 100644
index 0000000..bfca774
--- /dev/null
+++ b/roles/cgit/templates/cgitrc.j2
@@ -0,0 +1,8 @@
+css=/static/git.css
+logo=/static/logo.png
+virtual-root=/
+root-title=sublab.org repo hosting
+root-desc=harbouring chaos
+enable-index-owner=0
+clone-prefix=git://{{ git_server_name }} git+ssh://git@{{ git_server_name }}
+source-filter=/etc/cgit.source.filter
diff --git a/roles/cgit/templates/repocreate-plain.conf.j2 b/roles/cgit/templates/repocreate-plain.conf.j2
new file mode 100644
index 0000000..e3fbc35
--- /dev/null
+++ b/roles/cgit/templates/repocreate-plain.conf.j2
@@ -0,0 +1 @@
+RedirectMatch permanent ^/(create(/?|/.*))$ https://{{ git_server_name }}/$1
diff --git a/roles/cgit/templates/repocreate-ssl.conf.j2 b/roles/cgit/templates/repocreate-ssl.conf.j2
new file mode 100644
index 0000000..c9014be
--- /dev/null
+++ b/roles/cgit/templates/repocreate-ssl.conf.j2
@@ -0,0 +1,18 @@
+#Alias /create /var/www/git.sublab.org/htdocs/create
+#ProxyPass /create/api http://127.0.0.1:8023/
+#
+#<Location /create>
+# Options -Indexes -ExecCGI
+# Allow from *
+#
+# AuthType basic
+# AuthBasicProvider ldap
+# AuthName "LDAP Login"
+# AuthLDAPBindDN "cn=apache-{{ ansible_nodename }},ou=service,dc=sublab,dc=org"
+# AuthLDAPBindPassword "{{ ldap_credentials["apache-" + ansible_nodename] }}"
+# AuthLDAPURL "{{ ldap_url }}/ou=people,dc=sublab,dc=org"
+# # AuthzLDAPAuthoritative on
+# # Require ldap-group cn=members,ou=groups,dc=sublab,dc=org
+# Require valid-user
+#</Location>
+#LDAPTrustedMode TLS
diff --git a/roles/cgit/templates/server.conf.j2 b/roles/cgit/templates/server.conf.j2
new file mode 100644
index 0000000..bd9de27
--- /dev/null
+++ b/roles/cgit/templates/server.conf.j2
@@ -0,0 +1,19 @@
+ServerAdmin nobody-wolpertinger@nowhere.ws
+ServerName {{ git_server_name }}
+
+# Serve static cgit files directly
+Alias /static /var/www/{{ git_server_name }}/static
+Alias /robots.txt /var/www/{{ git_server_name }}/robots.txt
+<Directory /var/www/{{ git_server_name }}>
+ AllowOverride None
+ Options FollowSymlinks
+ Require all granted
+</Directory>
+
+# Dispatch other requests to CGI
+ScriptAlias / "/usr/lib/cgit/cgit.cgi/"
+<Directory /usr/lib/cgit>
+ AllowOverride None
+ Options ExecCGI FollowSymlinks
+ Require all granted
+</Directory>
diff --git a/roles/cgit/templates/ssl.conf.j2 b/roles/cgit/templates/ssl.conf.j2
new file mode 100644
index 0000000..c6b8fe3
--- /dev/null
+++ b/roles/cgit/templates/ssl.conf.j2
@@ -0,0 +1,20 @@
+SSLEngine On
+
+SSLCertificateChainFile /etc/apache2/sites/{{ git_server_name }}/ssl/chain.pem
+SSLCertificateFile /etc/apache2/sites/{{ git_server_name }}/ssl/cert.pem
+SSLCertificateKeyFile /etc/apache2/sites/{{ git_server_name }}/ssl/key.pem
+
+SSLEngine On
+SSLHonorCipherOrder on
+SSLProtocol +TLSv1.2 +TLSv1.1 +TLSv1 -SSLv3 -SSLv2
+SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK
+SSLCompression off
+
+#Header always set Strict-Transport-Security "max-age=15984000"
+
+SSLOptions StdEnvVars
+
+BrowserMatch "MSIE [2-6]" \
+ nokeepalive ssl-unclean-shutdown \
+ downgrade-1.0 force-response-1.0
+BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
diff --git a/roles/cgit/templates/vhost.conf.j2 b/roles/cgit/templates/vhost.conf.j2
new file mode 100644
index 0000000..b3e2149
--- /dev/null
+++ b/roles/cgit/templates/vhost.conf.j2
@@ -0,0 +1,9 @@
+<VirtualHost *:80>
+ Include sites/{{ git_server_name }}/repocreate-plain.conf
+ Include sites/{{ git_server_name }}/server.conf
+</VirtualHost>
+<VirtualHost *:443>
+ Include sites/{{ git_server_name }}/ssl.conf
+ Include sites/{{ git_server_name }}/repocreate-ssl.conf
+ Include sites/{{ git_server_name }}/server.conf
+</VirtualHost>
diff --git a/roles/sublab_web/defaults/main.yaml b/roles/sublab_web/defaults/main.yaml
index 367f47c..55f5b5f 100644
--- a/roles/sublab_web/defaults/main.yaml
+++ b/roles/sublab_web/defaults/main.yaml
@@ -1,2 +1,2 @@
---
-sublab_web_server_name: "sublab.org"
+sublab_web_server_name: "{{inventory_hostname}}"
diff --git a/roles/sublab_web/tasks/main.yaml b/roles/sublab_web/tasks/main.yaml
index 50a2585..0aab602 100644
--- a/roles/sublab_web/tasks/main.yaml
+++ b/roles/sublab_web/tasks/main.yaml
@@ -31,26 +31,9 @@
- wiki.conf
notify: Reload apache
-- name: Create SSL DIR
- file:
- path=/etc/apache2/sites/{{ sublab_web_server_name }}/ssl
- state=directory
-
-- name: Place SSL cert and chain
- copy:
- src=ssl/{{ sublab_web_server_name }}/{{item}}
- dest=/etc/apache2/sites/{{ sublab_web_server_name }}/ssl/{{item}}
- with_items:
- - cert.pem
- - chain.pem
- notify: Reload apache
-
-- name: Place SSL key
- copy:
- content="{{ssl_keys[sublab_web_server_name]}}"
- dest="/etc/apache2/sites/{{sublab_web_server_name}}/ssl/key.pem"
- mode=0600
- notify: Reload apache
+- include: ../../apache/tasks/ssl.yaml
+ vars:
+ ssl_server_name: "{{sublab_web_server_name}}"
- name: Create Website group
group: name=sublab_web
diff --git a/ssl/git-test.nowhere.ws/cert.pem b/ssl/git-test.nowhere.ws/cert.pem
new file mode 100644
index 0000000..c3b93f4
--- /dev/null
+++ b/ssl/git-test.nowhere.ws/cert.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDkTCCAnmgAwIBAgIJANvvC51+T1rFMA0GCSqGSIb3DQEBCwUAMF8xCzAJBgNV
+BAYTAkRFMQ8wDQYDVQQIDAZTYXhvbnkxEDAOBgNVBAcMB0xlaXB6aWcxDzANBgNV
+BAoMBnN1YmxhYjEcMBoGA1UEAwwTZ2l0LXRlc3Qubm93aGVyZS53czAeFw0xNTA4
+MjgxMjQ3NTVaFw0xNzA4MjcxMjQ3NTVaMF8xCzAJBgNVBAYTAkRFMQ8wDQYDVQQI
+DAZTYXhvbnkxEDAOBgNVBAcMB0xlaXB6aWcxDzANBgNVBAoMBnN1YmxhYjEcMBoG
+A1UEAwwTZ2l0LXRlc3Qubm93aGVyZS53czCCASIwDQYJKoZIhvcNAQEBBQADggEP
+ADCCAQoCggEBALe8DYJ1w3bZqg9UraAg7MeM2GJLGHijb8rJIdDftjcFELMzLsnp
+0B5HGQHdLhZZDretAjljVtT+72gzWtm61vmrxpXt5M88xqOVc+o8zsuiv39zWneI
+L/GxmLHsfrR3zsjXJZJN4CvMRJOSunO9iXJnuL967pF3kos3gR3m07EvJmDLPKRC
+T70sz7x9U4om9f/Rg4HAJJ2iuJdf1Y8nSqOp8ihCW/RaK+xMfLYvV5hc6htat0hD
+LWZzSv2ufWCb9VK2UzfMmE/mTCOK4owBXAfiGC5tbfS5c7j7NPer4E5jvZaHpiCS
+rAGbg4MXaodx75sGDakiF3fVokK9ndBC8kkCAwEAAaNQME4wHQYDVR0OBBYEFIlg
+JApsV/BrDqcw8T1XDxDmBus4MB8GA1UdIwQYMBaAFIlgJApsV/BrDqcw8T1XDxDm
+Bus4MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBACiX+r/8RxFQLSKT
+CX4tIO+PVcnFzDCP/cIw+E+2xz0PH8XH1EkehfKwao+sw0124aJMnJPheMJNtpIS
+FTBfDB4BK3LBjhsMO17swDy4w+hVecRGHswNU2nqE8nlyMDQYMbXhyFESWj9NTkY
+9UHdZXvLYE3tu3S2Ca/xcFRb6Q1IJUf6kjROpmv61ktmKPa5f3HnKbQk6JO9L4M9
+IJn3AA/5bZbHczYoDgh+4cCQmZQ9veJJiWcCrufKNMSB+yQFBhdm1QYF2E008lgD
+fQEdUy5OXE+uBzlPxmB2JQ0/9fZH7wNDGsAaxC5keqFFEGHoqoG//OhZMU3nJ0A9
+eGmb/M4=
+-----END CERTIFICATE-----
diff --git a/ssl/git-test.nowhere.ws/chain.pem b/ssl/git-test.nowhere.ws/chain.pem
new file mode 100644
index 0000000..c3b93f4
--- /dev/null
+++ b/ssl/git-test.nowhere.ws/chain.pem
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDkTCCAnmgAwIBAgIJANvvC51+T1rFMA0GCSqGSIb3DQEBCwUAMF8xCzAJBgNV
+BAYTAkRFMQ8wDQYDVQQIDAZTYXhvbnkxEDAOBgNVBAcMB0xlaXB6aWcxDzANBgNV
+BAoMBnN1YmxhYjEcMBoGA1UEAwwTZ2l0LXRlc3Qubm93aGVyZS53czAeFw0xNTA4
+MjgxMjQ3NTVaFw0xNzA4MjcxMjQ3NTVaMF8xCzAJBgNVBAYTAkRFMQ8wDQYDVQQI
+DAZTYXhvbnkxEDAOBgNVBAcMB0xlaXB6aWcxDzANBgNVBAoMBnN1YmxhYjEcMBoG
+A1UEAwwTZ2l0LXRlc3Qubm93aGVyZS53czCCASIwDQYJKoZIhvcNAQEBBQADggEP
+ADCCAQoCggEBALe8DYJ1w3bZqg9UraAg7MeM2GJLGHijb8rJIdDftjcFELMzLsnp
+0B5HGQHdLhZZDretAjljVtT+72gzWtm61vmrxpXt5M88xqOVc+o8zsuiv39zWneI
+L/GxmLHsfrR3zsjXJZJN4CvMRJOSunO9iXJnuL967pF3kos3gR3m07EvJmDLPKRC
+T70sz7x9U4om9f/Rg4HAJJ2iuJdf1Y8nSqOp8ihCW/RaK+xMfLYvV5hc6htat0hD
+LWZzSv2ufWCb9VK2UzfMmE/mTCOK4owBXAfiGC5tbfS5c7j7NPer4E5jvZaHpiCS
+rAGbg4MXaodx75sGDakiF3fVokK9ndBC8kkCAwEAAaNQME4wHQYDVR0OBBYEFIlg
+JApsV/BrDqcw8T1XDxDmBus4MB8GA1UdIwQYMBaAFIlgJApsV/BrDqcw8T1XDxDm
+Bus4MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBACiX+r/8RxFQLSKT
+CX4tIO+PVcnFzDCP/cIw+E+2xz0PH8XH1EkehfKwao+sw0124aJMnJPheMJNtpIS
+FTBfDB4BK3LBjhsMO17swDy4w+hVecRGHswNU2nqE8nlyMDQYMbXhyFESWj9NTkY
+9UHdZXvLYE3tu3S2Ca/xcFRb6Q1IJUf6kjROpmv61ktmKPa5f3HnKbQk6JO9L4M9
+IJn3AA/5bZbHczYoDgh+4cCQmZQ9veJJiWcCrufKNMSB+yQFBhdm1QYF2E008lgD
+fQEdUy5OXE+uBzlPxmB2JQ0/9fZH7wNDGsAaxC5keqFFEGHoqoG//OhZMU3nJ0A9
+eGmb/M4=
+-----END CERTIFICATE-----
diff --git a/roles/sublab_web/files/ssl/wolpertinger.nowhere.ws/cert.pem b/ssl/wolpertinger.nowhere.ws/cert.pem
index 48ccadc..48ccadc 100644
--- a/roles/sublab_web/files/ssl/wolpertinger.nowhere.ws/cert.pem
+++ b/ssl/wolpertinger.nowhere.ws/cert.pem
diff --git a/roles/sublab_web/files/ssl/wolpertinger.nowhere.ws/chain.pem b/ssl/wolpertinger.nowhere.ws/chain.pem
index 48ccadc..48ccadc 100644
--- a/roles/sublab_web/files/ssl/wolpertinger.nowhere.ws/chain.pem
+++ b/ssl/wolpertinger.nowhere.ws/chain.pem