From aba0370c5bb7d27c7e497858fa2facded7e88b63 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sat, 27 Nov 2021 10:05:11 +0100 Subject: [PATCH 1/5] Add grafana playbook and machine --- grafana.yml | 19 ++ group_vars/all/vault.yml | 438 ++++++++++++++------------- host_vars/proxy.adm.auro.re.yml | 3 + hosts | 1 + roles/grafana/handlers/main.yml | 6 + roles/grafana/tasks/main.yml | 113 +++++++ roles/grafana/templates/ldap.toml.j2 | 63 ++++ 7 files changed, 426 insertions(+), 217 deletions(-) create mode 100755 grafana.yml create mode 100644 roles/grafana/handlers/main.yml create mode 100644 roles/grafana/tasks/main.yml create mode 100644 roles/grafana/templates/ldap.toml.j2 diff --git a/grafana.yml b/grafana.yml new file mode 100755 index 0000000..fedc0c2 --- /dev/null +++ b/grafana.yml @@ -0,0 +1,19 @@ +#!/usr/bin/env ansible-playbook +--- +# Deploy Grafana +- hosts: grafana.adm.auro.re + vars: + grafana: + root_url: https://grafana.auro.re + database: + type: postgres + host: 10.128.0.95 + name: grafana + user: grafana + password: "{{ vault_postgresql_grafana_passwd }}" + ldap: + host: "re2o-ldap.adm.auro.re ldap-replica-ovh.adm.auro.re 10.128.0.21 10.128.0.149" + bind_dn: cn=grafana,ou=service-users,dc=auro,dc=re + bind_password: "{{ vault_ldap_grafana_password }}" + roles: + - grafana diff --git a/group_vars/all/vault.yml b/group_vars/all/vault.yml index 8f78c92..ac9dd3b 100644 --- a/group_vars/all/vault.yml +++ b/group_vars/all/vault.yml @@ -1,218 +1,222 @@ $ANSIBLE_VAULT;1.1;AES256 -34353636353331626234623838643238343237306237313336663433326164313030646263393165 -3964666632653139323634663061363763656533373538660a393464333663313633393866383432 -31303736366665306465333037373835383266383035626666353461623435393438303861376435 -3161393136653361610a336438393566393936633637613436366634353237313363653232333263 -38643566626564656635316564363362386236356164646238336265663839363430623739366266 -66333233666439656561626161653336633136396565336633356630303436303234613063396238 -62363437306639343236636537303363313236633765363430623865323734316531383662353763 -37636439356164303730323235346362393436656333393062333566336536316131343338663630 -31613063313034396162323034313562356662653266636638633665376531663932653461636363 -32653061386562376237653837333239326438656630646138393362383539616339393365343435 -63616462363733623930623435333435333937336538353735626161666162333337633931333338 -62316638373736326432373464326266373361613864633262656432313364343366373832643865 -64343866393966346534623238386437373632326632376166396630613630613365393932333066 -37663162656134346564353762383961386161343064373637373634353231653137383461626666 -34666365656632333764613931643266613737393032366431323764623830666131386566613535 -30346631396237336332636438653339613633636662663266663235613634346162316134336533 -61353361353437626231393137653464363934383233363830373961373033653336323666313836 -63643638353438363661653239346530366630336661343336303836383439613462333532653263 -63643437323166386230663635333130333632376661393830646365333666323239323134386636 -30656266323839633237663433376136313437366264633039376165633961656137363038616534 -32393330656464373739353833646232633634333937613932393834356535396464613633653334 -33386231313830656562366335333162386461616331333733343163313562636232646261383135 -36376131333931303566343337343539323265313931346538343539363230643030646531373134 -36636364326539356533363832333661396435363365633831346664393165626330356536343961 -64613935636333333331633931313266633732663430373166393362373431353363316630663235 -31353936343932386665366134643962313937366634396262386434396334383332343537383163 -37323235326161636339323237643366323430623136323937353665383364306436616664356662 -38616466636465313330303464343665333163626231613164663030623963626634383965613135 -31336632366231613062366430393636646535616134383232386334343137333138643866393633 -38636161623734613862313638666562393164356536613665303839633035636330353965356163 -65646530383162323630633865363334306234383466383033663762633933653162356166376138 -33343832323466333132386564336636323765383839366134636433613866623830626133303434 -64643066366638316633663338333335313466366433313134306239393233663233333730333138 -32666133633931393961323663353565653532323837316165653536396339316364623633613137 -30626636623037396438636261633939643363326136613631376139396538623932356237313637 -62656337663438623666633435373564313566636538373339663731393564653264623863353032 -33613639616135623735393364623439393432316632626239313837653464623563393663346163 -36303764343562376337366465643434646263383133336162376166383434633436633263303263 -61656536363037666230393063336263363865356465616231333966396332383434366265343434 -66363732313435656164613135333762306464373133343739636266346336346261366535316230 -36663433616332386166323965643436393433666264343062393463653339646264353264366663 -31653331613138316138383930336163616333666161386466616566323664346263396637393735 -38386462313763346164613430653133316631633261356663613738663435313963303734373364 -34353332643366353930633339373962376162383239316134346561336539643737656239336230 -33613662646466383434303638343362323933643831653932393030383762323539346332333961 -34616338386361353362366434663365663262383835383031393430633235393631666332623261 -36393231366164303165336633663565376334643864323366666434383634353031326633313266 -66346234323036396562313366346661333130363434643565333763316234353733383733623839 -37663761656131363932333330663638323733666333336636613264363164643230343964643061 -37633264313865373732653466356639653335313236646331623932303963326364343132656464 -65636665616364373538613732643938323364626166316437623166383734316662386134316233 -66313430626133303461336465333532373361616334393139663233363132393265643865656561 -63303734313934343636333135373164636536663935323030366563623635616535616230363061 -38653362343264626432373866313363373439333331333963333765356462323762333739313061 -33626365663433396562633534643630326364346135383531343063373266633635353130363166 -30363735386665346661343166373034663466636335323838666465613163353039366233386562 -39626462383635356230343031633666346561376462376634636236323164626537396337323337 -64653163623030326435623833383136386366613764623633303732613337373732386432303737 -61303530356461343339333165663161343262613434306162653563643765323837303537653963 -30383964336230326336313765333832323639626131303063363030313537346463393765303132 -33376633313135613832616239343939363562363132666433373966616166383836376636363630 -65376266323266636430383236616338373632323134626165393961383733363365383761653538 -61386365363262623665313637333761626561643530376433326531313161303733626432333866 -63663762313130336535666134343961353337653034643436363263306664666562356431313433 -63333034623762663630323031653363356666366538323064363866366662656466666361373938 -35653562383865363437346466663963326439316531396165376439383931366132386161346364 -66633334666239393336383336376130663633613161306564336131356435396639336566636131 -37653763373537353635393536363531626332313461626166373763613861346433653237306636 -39393435633163386164356131636530623732316538646133316365383561653061376431333431 -66356561333637353537316231616133646231306462626439326462393131633562393462396132 -62396337626436336230636338373439343839646266613033633930383530363932616463633538 -35646230393536396330383566346138633434333063333362313139643537346236313336376463 -31363335633333333262316239383735633139383332303235623430626539626466336365306465 -66396336323637613036616532363963363430383737343566366162663836396132353933346534 -35366565336462646364643137323864656334336635376435623561666530386334623964323136 -39653365646161366330376336353931633366653832383966656639393364386438363832333934 -34616536653064363739333363663233376631636134323162626333343035396265666662636230 -31343931323435373964383562616333333835326238623131646433366134343830616432643866 -36353363356532383963623364636363393834343132303434393331653335313938393662376534 -33376565613433373864666536313439656339306532643233336137363264303638346563643932 -35343838616538343262613066343665386433386339373362313533643639326136663430363135 -37393734306565613566663632643639343939353361656566663431386539333136393663656262 -34363537333431356363633932373736383262343336396666383237616661353763643861376537 -63306133353331653833346339663062353438356162356431333336373536623439366132343930 -31623736353532323230373264363163386339346563313236633061313239663962623136323962 -62333166636230363333633661336539373962623337666538636565643664396132613263633461 -64663430666630303562323065613838666265653438383838363561303637663931613239326639 -30663533376662333162613731636665646565336465396132663165613431343332313038613335 -62643030376564306335633138373937613934653738396361303064306263353566336232346639 -38323266373537646334633761643933653931646439353939326536383463373666646262353362 -61356230333461646435353332656564616464363539373966333535653365326330333230373539 -62613335363632393335306535643862653262363031356439386639656262353662656432656331 -34323431356337646238353135326332346431383535643735646562386161353164393961646264 -63396161316563323537396431646561633730373930306637623438323761613935396238363965 -61613339353234626565653939643139626665343439626365656165616437653234326530316464 -39303433333533643439313464623531646133316563306337386261356332393435613237653632 -63386439353136383265323965646538316334343661376532323461636666363630613836366233 -63326465633438633564396135386137383061663264373530313330666639333236343539653734 -62323637313131613839363665633163316235306536343039626166396263383332363365373936 -66356135646330373162346261326531616538303566663761626639363635633064623361663463 -34373937653165376262643064653738396365353532343864653836306231306566386665343963 -36353066346161323733346131386466653964653961343136643039653035383864653238663265 -35623565303731636164353664666636303430333933616230336330393530633032353037626339 -34326664373239663330356430346531663635646161356130623733303862613964613433393334 -33303735333934343964363230326634653465623465366465386639616361316139323536363261 -30313531363533356636303565303265363430363530356662313838646435316439363263346165 -37666463393332323066376464313339383138343235613438663464613436376237333565616563 -31363936393731623562363331666433626636396136636533353435386634336363613963636162 -33306233616636363432316236363665333162393133616130313530313764643738336666316639 -36613263303138633039376135396266613766666261373436626333373035393863376133386162 -38633333353963313433636236636339666135376530323731663761303938313764356636363963 -34393035333561626564313638656266313666643166633163636630633938346661653033643832 -36393632633765656661353236376432383034343766643336353236623437356638336264326364 -30616161633130653131373932303337616237656633346438323832623964323332613836326365 -66666666663766653865636435623562643637363134333336636231356332356439396262386338 -62643738326437343139616134386130616533653066666631633139653038646336306363373233 -30626134623732393361653637313235363463336331666231336434363432646363373534336661 -39623864643130613337336232313263323161313030353535313336393233643237343566373063 -64633935366430316566306461313261633031656562356461376632373031333462323237646263 -37343535393539393032653135653666393933326632653166666633613638333130623937383530 -35323737363662346337326134366239666137343031326663356533353033633332633931333738 -34383937316461313231313936626436633030373833306636643633343266343461363732373132 -66396233396432336336623166653361646561313432383861313061376234656636663864616132 -32336664636162346633376633353938613865323162356437373330306236383164376261613461 -37313839363331653139623264336631663534643530663434393535333865353965343161636638 -34653334373865356439333736366432323832323834633239333130386639366163643337303832 -37383637366231613930633661316466346136333666343266393137663965653331303034356661 -61643439383630353139613635636665616534396639643161653334626434616132333731323532 -39363462313039336661636332623530363832316564343135343330323362366633333632646239 -34633736383534653130343437376134616363363736613462326332643031376331636164623837 -32316331663030383762333562373937663663633931623535303139306163613962643762353633 -66643038633630633736316634316238643136363532396363323361323163363638653331616631 -30303832363163346663613433646432326566613738356133386238386266376261336532356338 -61383539336138666261636234316461646365373236383038363965626635393530346236666263 -38636164336463393565613362626334346565653464663136316564646631323835626364333536 -36633566613432346334656665636134386334663362633562623938343264396538656432366166 -65626635336139306335366265616430366337656265346235653333646362383232386434663832 -65636634646363323736323165666637373661333136636164613933396130633932373837393030 -38303466303363623038336363633037666631356262396631396464383065343730346537303534 -62383764653763313639313332386331653163313134303336396336323862323063643265383761 -35633939626636613030653564366266346338346239356163383864383762393261396561613032 -31313866356666666538613935653965373932366666303634636436633662333638396563336161 -32303934373238323838366563623035663863393835353839343230626235353830336532306532 -36303035613238656133643936353735646336396238363334326561336365666238363735633561 -62616338336664366631336364636564393539363163626465613530343939303961353364666364 -38666665326563333039386462656261666531646637306261316233336130343730663661336431 -62666138343766393262313431386136613139386265623939613830646233666134386235326564 -36353032383336353763363231313564396630363565666163316237323363633866323734326664 -30316533383363363461613564646137646337303738373833373238396661656265626139333637 -30353835363062393333646433356362613132653463656532366137356136306431633836653333 -65326266303038393233373263313933323637303539353065663233356333326235633064353536 -30626433356630316364386332393331626135656266376233363837303438636539386434613038 -31313938653662306533663635333564653232306436396331386433343561313365633664383865 -33356163343232626165353739386534346231336634656231613235383536616338383133383664 -31303734363836326662633062396130343637343731613532353533323164353934383230626436 -33356139303663326361333535306261386431343736396238616435633565613266306339363166 -61646233353636303739353336336662633662303861623864323033376133623734373436646365 -33626332366464393166613339623663346234653830386664396630376539656163633263663664 -63646539353035323263306136396537373561646264363939613737313462643063663136623136 -61643138623962383039313836633032323861313937643164343832303634643833393230656637 -35393566396562343863323235333835353135323139613166303539306266636265363931336162 -32363361356231326164376533346464613836373162323333336438333532333161633432343637 -65356364636264313036643836643863396435663837393564393833303037643331363633643065 -36396662626462303232386531653234373231306131353732656663353538356636646331646163 -32306362366264343966393237633831633263383236336133343166633639366266316235386538 -32623039366561643663653564633066306339613938386234666430666462316363373863626337 -37366232633365653462613732353064396539356432393661626462313663363634613434376462 -61316266366131343239616133613038303338323566633363666330336364393261636130313164 -32336237383536363562663537343661306434313964373034376263373262643635316664646130 -35333631626236653638633661363831323262336465323339356637356331313738666634656538 -34363438633566393866313662386365313030646230393862343735356535633366666138623863 -65306336356633326530303932373634613733643364336561653737363132343534333336376264 -34663965373532393330393763646232623533376332323239376232303935393339656230356537 -30306264636362353733656366363139613637303264323361333138666462666531323131663564 -62616362303035613733386231316431326333643739373738666135363232616564346238636462 -64623234363632613436636336323965383762626261626137386631393334666266343636323862 -34326431303365393234616263653862376466363861353835316336633336613534373235353436 -65663531303939386233353934376335643732373063666362343234353037363430356233356138 -34663530643266343535333336643938326131366239333630336163363263613561393639333631 -63333031643033623964303361383462343339353264656435626365393938613162623835646539 -62626331393339373839316166613965373862316438636561306162376535633861396531396637 -66623936323361616333326330616361323232343034343366643130623037653463333730316337 -61383965663130646334343833333737383931363339326266666437353030626262633263626135 -32626239383137303538623735343033633465653861316231636564653535646662646561333832 -30613639353563363534663764376232643630626434626466306663303331643565313239353131 -36303363306538393164663563313133636663653664616438346235646637636132373532393332 -35633533346432616532653937636565363431323161336430323566363239373035616264373636 -62306337323935336332663262396466323064633738306334386233663531313633656232373330 -38656635636264353635356165343233643061363836396266386631393433366265646662633239 -63303939363637663030663965626637336366666638386532666466613965396533373935346135 -62623837643462356334323234633263636130653762636461353037396461623961383330613731 -61626634383232313337313363363637623036653630396266623265363961303662366165373462 -66656364633735626231323335373135663462373966396136653634653865316238393263316464 -66663537383763386335383131303438353930366534616637636564313431346163353534366431 -34356262653134656633636631373963393032393061353636363333313464386463616638663939 -39306136373433346362613934626332316633353232373963633939336338656331366661666232 -37646566393062643738383832363230393337363361653566303433666561643936313037653662 -65666266353032313862666365313237323431666365613666373931383838383435663034343239 -39323139336266373463323465656237366166653230373236613335616433363465613131326234 -39393363386334303963613036333661373364633437386262363937333565316639313261643133 -62626235303163666435333030353039316432316661383933353834313733326435613366313030 -33303631323132323861613366313532333931623739623731353566373039656133653061633637 -36366365653836346662616135303536613331656364306163633731376634313739633634646132 -31396138663337656332653331616462333936313531646135663930616130623338323733663634 -62373866353663336138346335383637333738363035393366613434306536643239356436396333 -39333133366235666562383239363530343464353735666436356333313932613965613065663639 -39383962376264643337633365386164353166343165306634376634646233626466363661666465 -34306533616238616131306130323637656536663561306437346238303464616636306134366130 -30386566326465323962396130336661613433613938633565363635356166643263383364636164 -34643465353664386437316366396130383533626132363566656265353366663865616531386238 -32633831623334643166356237353164356563646132656130363634343664663765373839616430 -37346432616161636139643733346631643165313636323231643461313164646663623439663966 -33323230376337663566636233333038633465323238636533336136363037633065336538383033 -31356634363261643064326335656535356434373862663935316434613938663833626139646636 -63333936363637356234373237326430376232623561663461633138363032616138343730663939 -37353462326266636562373331326161646338623261303762316265323432313139356439306361 -32336132376439616662386132363566363438313739313830393336393439343839 +34373734643731373964636230646139623730383435353633356332333639343236366235333731 +3934326537386335393763623466613139366534396331640a323936636562333365343732643736 +39646133356363363838646662303862306531303330643863616436313762383138306538363335 +6563663532373438310a363235336531613561613337316131623330373933303035343465653032 +61343736333939636230383332636366636235303134393761626564363630336134626233623532 +33646363333435353663383332633635653033353335393638343831326431316535333032646266 +36353734356339343533306330323335396636666161356466316666373466646166396263316531 +33613534396634306437393561343036336538643862656362386563356464663135333537303438 +36633264666364323434393062383435343438316565626339323834343166633361306137313764 +64613736316566666534616636376334613032656563623565333933306434623364623833386131 +34613035613336626165363939393939306233316232376631363363396231336161623236656131 +31633434643862353333386437383036326239356332373434623834326631383137386135313464 +66643735343338373034336461346135643939643861646238366334323036633164303838353563 +34616366333761363865313134393131343739383862376361373965313634363762616564346465 +34336130393164386234623138373036343931323863336133323066326663303939646437383563 +64323338623539373332333430313235653666353436333234643734656334656161336539663463 +33336632343562316539353166623839646336316264356139646566303436333537396166346435 +64373262383839616136373030633738333536663430316664383330336536366630303765376664 +30623330363536333032303631326361613035366533366464663932643238616137643834313730 +35346563616136343239313164343466613836376365663665346164396332366134626337383635 +35613064623964306539363033653061656662373838313766376630323336653561373863396664 +32353263353733313062653934313261373763386231636132323139626135393132313530636539 +64623839363835333237313334313334663637363063376665653236613631663036623764303036 +34646333313531396562306633646432323436303732343832313562643265636531333364313136 +33643033643834313030656639373163333634656266306634306263633865386537303163636230 +64366664333131353866333331653938313737326135373334343539666239663537323238343930 +62613334343466336431343031373432313763643031316163626463643463653539663362383966 +33323431373630663138383734663636363932346538393637633832323364326164313662366666 +64303265373931333231643064643563613666633036376632343266386338333461313764373131 +38393435353634653565646465643061643766663661633333323665356534396437613539313465 +30353862353536663239383036353438376439323236666432396366316335376232323464356633 +64386461356363323732366263643130663461306131386535386131333230633465313537356332 +33643533613030333364346663646231613466396461393266323564663932626138663738363363 +34666439383532313062313436306561613330383433366136626135333330386266636531323461 +37313530393839336461626131366264396332303966353731376635336666323239653334356337 +32396431633965616566383538356431643031636234633730386639363934636134616463343639 +62373934386332313130323437313737623337373735653838316231396663343931393336393731 +66313263646633663165613066643439346530333163633733636366383135633265386262376338 +37366261316165643434353733373339656564386236353732633831396461613138643962363732 +33303331346365323437653933643763303161613338383236376139366561333737653639353066 +61646432306336316235346136636364356233366366383832336263353638356265616165666538 +62663431303231363238623061393032343263383535636339303762316261386161666464323132 +62383835373934626262623538313836373034623931616562626131636362616133663965633966 +65363435373639333236613335363666326462656638313132313361376638613238373634303031 +64326338323631663738333032363638613439633134363236396237663735336332643662646538 +39313239343834316263626663353432396232363362663365326430633862663335666630323062 +63363062336532303266306436383437346239356566613432653638666539633835373933633934 +66626162633539613765386437613565393737363962396265343835353930363231356433383238 +66613661396639333539333634333064646230663666303832333163643663386162363833356233 +34363465636136353465313932363636633261393839363934663366373164316239663437363631 +37343038636339313563643933356435396664343233376365323265306165376264396638306135 +62353034376637386631353133626662643238663864666266366163646366613036363538303133 +32613566376633663530383062643538323466313837303430666232343832323136323531666133 +37623231386365633938666564643862396466633430653038333833313163316230373032323939 +39616433316461326334643333306338663938626636303536656337646432386666613163366331 +32313263323566313038383339613765363834353133313834623932633736323964383939613139 +66366266653862333361343761643535643738623536646336653531356361363539616665613665 +61306330626230393365643964626133333831343830383666306364386539366336663064653361 +62643631653037316234616637386663313031336662353765363530333731356636353337623336 +31396462383030643435336231333266666262613336303232333164393935336261393863643764 +35393038346166663430353032346537623165393033353330636433663262623766373330626166 +31366636393466613733623536666537636361343734643938346634323939666264633430633934 +30376431336533626631306261653634663565623037616432613166396262313162353363346138 +32376461393064666661663566363336343437633065646434663430633334346335663733653234 +38353939306366383930616564313938653065636261373564313166353639363863326530333831 +32346137613166316163376632656539616135316539383432653530323033323232656636653435 +31633061643235313933623462353865343637333937383630653665323038316461316561303931 +61616135373666313165396664316538313434336331396539343733353461353138306138303538 +34393362613264313939396265616631646563363631316564353432346330353434646537313736 +63303861623734656463663762316435383963623035633533373736373762643930616562666138 +34383839616231646436653033313635343466326437613930396361316433646435643137323731 +39396537353665643434656235393665396465623135656638313933613765373536306665663361 +62393339356633393861666461663064306331653961616331396262643463393634336662333166 +66626635656634303030373336616563663730376562613335626435373232376465646362383436 +30666333373836626264633837386662333635333737616534343862636237613933613433326433 +30306639346666636230386130383932336566653636613264366462353439396335666330623736 +31643236343538326261653433333736653035343037343330643732653435623566373336326461 +35643236613038656438643238666635386433623365353436333632376564633261306365386238 +36646262613139303731396165633539653839383234666131346165343031666565646637323630 +39626536353230366364623962646163623732356434623839333464636132623466336637333736 +62393862356137616339313735626464316562343464373531333838626333393331623734313565 +64303535333265613634386565616634636133306162313738643834613035643062396233303364 +39316261633665343262363866366466363234643565336663643335396564633463633538373363 +36373331313339653938646132356362306232623435323336626437313934353364313762623930 +30303065356565633932653364613530613435396664363938326433303761663336363234326532 +63656134643234383862323730373333386130646565393165656463353062626130613237373834 +63313764646334623436356236393333376262373238373266363131396437333331616333623663 +36626532613730353932336437316239386164346335353635393661386561643531333731333939 +61616637343766626431306632316265306138636639356637306630336263363061346439376563 +32373166393835343362653330306535613465636264376561346461323266623934633965376536 +30633639343935633863636465643535626164636635623662333036313930633062373861356334 +34333631396530646532656439343238383865646534303564653038396534363234646638613766 +38356463613765656239663131356439323738373862383063313433356632636331383266323661 +38353364343338303461323533613562383637656633366435616530383735626464663635613465 +64646638326333666236323831303364363530383236626237303130343839656561653866346461 +35613835613761663262353036363465623538616162636234643962396330336161373739333763 +66636332613433303362623533323433353565383430343536616162366435653439353863313836 +31323531623237303165633164623235666134343765613836313561363663333734653161393162 +36386464363031366466343962383661313435616263323338366432373661336137316530393737 +37346432633065626634616630643533323163383362383034383166326136313061306165356639 +32646166373564326566336435626530343337393262323434323464333537363638346534313265 +34313133326236346565656138626263646165386235363834373833643538323764626236336333 +36343833383164316136326263303730386662656365393137343361643538646465306664363032 +31373862313330346630646439393965383735316563303838653461383864396230643033313531 +38663237343838336339653439643336383366656431386464646464323562663763363930623336 +63333936653133623565396264356261313063376236636462326432326433393863323236326136 +39396563393963653963323631393934346639656632303632363332326562383534653732663861 +31653933653066313134613634326562656632613932396136333639353633653635376562363066 +62316264613032313963313437636432393336313336656365663536306135666130356230346132 +34626563323039326237616562653336653065663435363163383765393733376639633839393731 +33623533623635656432626431653565303934663765633364316232316461363832376364666566 +38396334613438366264363730613238303065613765343839336532373838396630613165643937 +38376135646133363938336534613437343061303832313461376336323937343465616132383330 +30313831363333383962393934303134313735623234383662623935643831653462353334323733 +32366361383536343134633337393363376231343539663331353063326234633135376663343937 +66366665653963616639343735343438386637396664346537353534313366376439383739303364 +64393464653832633565653635343938306239376538633064373338303837336434383566316366 +62636539386464303663613261343262303536643530633238643565636636666131623530323861 +63353761366462396533303637316230393461383066616332336333626435396134363938343732 +63313464623061353565366337346563373237656437373936623237373163626466663432653831 +64303064313035393138646131313563333230383965333534363032393134633538643966656564 +64633934386632323663653035373234616438363534663439653130633533643234323737353165 +61356464643534323237626261366661396637323065396239313831323233313534313766393763 +33613062353338623936666463333138303761383336386431386637353365666635306362653866 +66326339303363313531376537323363656431666131303563316134616363633335356232663536 +30366339613063303166366139373065393130393436343838313261393331663239303531303735 +33336236383539363131616366633030633333316530313137643836363938306136353536613764 +63313035656530653837323662303032626630613033656133313663633439643835613539396530 +36383936346164333566666133303637343363336331306530336139626234376538636464636533 +37316438623235376633663462633632353630633363336163623835396561656434643736303330 +63323230346364316130643563363637313062323630643865663031643637613136333130623765 +31323463316463393465306538626435343935376664356337316166323136633433653737666663 +66666532396136373931616539363737303232393638346630366636643561393034636436386464 +64613066303432663734346538383766313333316562346130376565333636376330343530363735 +33333733353230393761633032623065633830353739633937306461316266353439356138626538 +61643631386239323638386664613234343635636666643835343039326530636263373435343633 +63393261333933376335366137326536316134636438323131323263663538393931623639646662 +30343032653936303066336135626363333032333265383661383563316532323165303838626566 +36373934303836643361633734363733356165643037616430663432623233393065396166396364 +33333265313666386463633636636439373861303661623166326631656434663262396630376231 +32366331386539343436373534626339313335393038303832376666613766363032663062323965 +61303265636235363330656264346332376261316532346465626235393961643734623161333736 +66666631393738653365656664633436333964666364386239333031383664313763373034386466 +63653931343630386635303263363962393635616663633834373138376134643437373563656237 +32643138663334643764356562316537633065666233363133303032393534316135323761313866 +39383139326131363731613536363434313163643033633730613330363032333937396633383536 +66363262313336363131306538366634386333356132333066333335343237393830333734643464 +66343635643632316438353761333864353566663863333362343637646231366666663433643763 +61326638303131326439316462336164396335653736373938393833316661616335343064653632 +65623739313433643262633832303664666635663930623864653935626532343863343834313037 +32306534353863656235333533383438366261653465323066643130346333383562323464343666 +34623431313334313062323335323230303438626162316139616361633366313066313265643065 +36366433643766616561386465303936613030633164636237363034663865313535313564373534 +62313334623337316537353131383833653465626431353161306163333338616136646531313162 +66333464653565383463363738326232613864626561613132663930363464666537323938333836 +32643665613761626561306534656331393931383262343762323333653963333838643035326362 +37336264383539363232313332363463653030633331643161643263386235646664623634343063 +36376632396663626635626530376235613132336161363361353964666263313837316130346665 +65303736343037343337376134666631626432313065303737656365373233396635366463666239 +30373264363034346333663766383563616136643862373135343735336637616361313532666437 +38396434356432383935663239366237373361656235636263333037323238626238653032323839 +64376430346430383735653836633939373066383562373166376665343162346164336161656464 +64383638373066333535373664666661666466326162623536323837643137326261663237343030 +65616135643032623138633566353362663061623566326464313365383831383434633164396238 +62396437343338366338386433363934306232346533346638643739613066666663633861313864 +33376466613164316662626262616635353239646466373334303164306331343761653633376530 +36646436653966366637326364383531336637623162393763646561323034653938663038663536 +31306163653534333161653863393532383032343030616330356462353530336232383037643064 +39383630346164356665373737623863386664333264613463643530626465313237623232633837 +34386534323334323431646430353061623135663537366335346661373338303033616238666334 +38666564396238346166616634353732313630636664313938656664303935373165393936386132 +30383361376339356662326666643966396266386630313863643830656230623234633135653333 +66383234346434643761386337363264376538623433643337316239656339663565306661653439 +35663764356563376161323232316533613132656533663535653237653861633463373536393733 +37396634373033656437613162346333306435623536353437346366386537613563306333393039 +37383437373339643566636561623933373931396164653232363331633663616530353935376437 +66366633636338666262363637313132366463646134663833393537653139643136323961363537 +64323661383138656637383239623930343631623564663834623265393430316161653837386665 +32363037346563653131653735623763303965393864376436613636616632656631616562613538 +32393962653530653433626162326633643866383461376335656134396431626465303137393763 +64306433353363633762653737626536623639333432653137643166636662366163646265393332 +39363031646561633532306531363838323063393130346232323839393932316330303337346439 +36643733623762656134316331363365376237393937653961653263343463373562656433356163 +30663861636139333061303664373462313131383265363137633363346635373337663834633333 +34386431613938373037643865393735646335323466306563626139306637663461643561336335 +66383765623734353931393837613637313864626562656365316439303234626364353766643031 +33353830643236346265663738306463636338306434323139323132396464633264366338303637 +61663439323035353034336366363737666538623432326262656164613962303466626562613031 +33616134333136393165326335643164613433633361353839656464346331323762323339623263 +65306634613434316666396262373332653563313534303064633934326239646263663438623738 +37396630336133626436336263363732653537653133383231346130653136616439396131306565 +35313134383037363439663266383435616136323134633565613836306333356230623031393634 +38643634653162663933623334633364653632353262303664643132633033373461383662316131 +36373064633464616464643333616534613333363938663131356431666331333638353561353037 +35326339333131646536353766343537656331353130663762346333656264316539623833356266 +66646337313430303134623232653633326466393031356330393463353730383236613236333266 +32376561663437393764303563383535386263356161626266323231633866393339333032353132 +62363636393133663164663436373839353032336131646563623562623431333831383761623236 +30363239313161366634343935313930306364346162643461636430303863663136363238346339 +37326564623735363065643066303431373662353736616333336234326266663435333966366339 +36366362613961363766396636396561626532383639643839303266616131353931376366313862 +33356639346566333065373831386566363035303339346632393730633861356231383238333239 +65636435353937646137323463613066343531356236386663626530316139643539376536616161 +39353562613930326234666662383461333666313032663032303962656465353731323736376231 +36366437653739346138633761373931313465613837663863636666323039323866333933336432 +31663138356633386131323766396264353566653132393439643533313966393631643433633436 +32316336656465366162323665613166303938313431363861666564303138323534396230653766 +36636265343236393539663936646265376436343564376362646334323962356266626662336463 +39336334383162396262653464333766666431363862383738376336343961636435333263323061 +62636135643131623636306535666136323964306133666438336335643761393339616438343065 +63386661663532653138663165663932663838356236313534323462373539623465356664383435 +64363361366335316139353431666536343331396366316265313964373438366633643766393139 +39656564373462353531623234356534306530353436663333306165343932333232613132356664 +64323735323535353036386430366363616337376532376630383834393336613034396262623130 +35613663643436633464633866343963386535383165666163643563353763366661616166626131 +35626139333533313336333633326439613363333339333531666432633861623063333461343933 +66363135376562633239333637333730663862383863653438333763346434326134646161386438 +38356237376637396664666164643332666163316337353038316437616233666338643638306663 +30643130636264333439633263663739623463626334633730333265623263666566333237396630 +63393936383365316237633936313533316364646364643534656436383230663066373533383734 +6130 diff --git a/host_vars/proxy.adm.auro.re.yml b/host_vars/proxy.adm.auro.re.yml index 105732f..c85c7fa 100644 --- a/host_vars/proxy.adm.auro.re.yml +++ b/host_vars/proxy.adm.auro.re.yml @@ -70,3 +70,6 @@ loc_reverseproxy: - from: netbox.auro.re to: 10.128.0.97 + + - from: grafana.auro.re + to: "10.128.0.98:3000" diff --git a/hosts b/hosts index 0a257be..dec08b1 100644 --- a/hosts +++ b/hosts @@ -38,6 +38,7 @@ bdd-ovh.adm.auro.re litl.adm.auro.re log.adm.auro.re netbox.adm.auro.re +grafana.adm.auro.re [aurore_testing_vm] diff --git a/roles/grafana/handlers/main.yml b/roles/grafana/handlers/main.yml new file mode 100644 index 0000000..942149c --- /dev/null +++ b/roles/grafana/handlers/main.yml @@ -0,0 +1,6 @@ +--- +- name: Restart grafana + service: + name: grafana-server + state: restarted + diff --git a/roles/grafana/tasks/main.yml b/roles/grafana/tasks/main.yml new file mode 100644 index 0000000..d20b847 --- /dev/null +++ b/roles/grafana/tasks/main.yml @@ -0,0 +1,113 @@ +--- +- name: Install gpg (to import Grafana key) + apt: + name: gpg + state: present + register: apt_result + retries: 3 + until: apt_result is succeeded + +- name: Import Grafana GPG signing key + apt_key: + url: https://packages.grafana.com/gpg.key + state: present + validate_certs: false + register: apt_key_result + retries: 3 + until: apt_key_result is succeeded + +- name: Add Grafana repository + apt_repository: + repo: deb https://packages.grafana.com/oss/deb stable main + state: present + update_cache: true + +- name: Install Grafana + apt: + name: grafana + state: present + register: apt_result + retries: 3 + until: apt_result is succeeded + +- name: Configure Grafana + ini_file: + path: /etc/grafana/grafana.ini + section: "{{ item.section }}" + option: "{{ item.option }}" + value: "{{ item.value }}" + mode: 0640 + loop: + - section: server + option: root_url + value: "{{ grafana.root_url }}" + - section: analytics + option: reporting_enabled + value: "false" + - section: analytics + option: check_for_updates + value: "false" + - section: security + option: disable_initial_admin_creation + value: "true" + - section: security + option: cookie_secure + value: "true" + - section: security + option: disable_gravatar + value: "true" + - section: snapshots + option: external_enabled + value: "false" + - section: users + option: allow_sign_up + value: "false" + - section: users + option: allow_org_create + value: "false" + - section: auth.anonymous + option: enabled + value: "false" # no public access + - section: auth.anonymous + option: hide_version + value: "true" + - section: auth.basic # only LDAP auth + option: enabled + value: "false" + - section: auth.ldap + option: enabled + value: "true" + - section: alerting + option: enabled + value: "false" + - section: database + option: type + value: "{{ grafana.database.type }}" + - section: database + option: host + value: "{{ grafana.database.host }}" + - section: database + option: name + value: "{{ grafana.database.name }}" + - section: database + option: user + value: "{{ grafana.database.user }}" + - section: database + option: password + value: "{{ grafana.database.password }}" + notify: Restart grafana + +- name: Configure Grafana LDAP + template: + src: ldap.toml.j2 + dest: /etc/grafana/ldap.toml + mode: 0640 + notify: Restart grafana + +- name: Enable and start Grafana + systemd: + name: grafana-server + enabled: true + state: started + daemon_reload: true + diff --git a/roles/grafana/templates/ldap.toml.j2 b/roles/grafana/templates/ldap.toml.j2 new file mode 100644 index 0000000..ce97e46 --- /dev/null +++ b/roles/grafana/templates/ldap.toml.j2 @@ -0,0 +1,63 @@ +{{ ansible_managed | comment }} +# To troubleshoot and get more log info enable ldap debug logging in grafana.ini +# [log] +# filters = ldap:debug + +[[servers]] +# Ldap server host (specify multiple hosts space separated) +host = "{{ grafana.ldap.host }}" +# Default port is 389 or 636 if use_ssl = true +port = 389 +# Set to true if ldap server supports TLS +use_ssl = false +# Set to true if connect ldap server with STARTTLS pattern (create connection in insecure, then upgrade to secure connection with TLS) +start_tls = false +# set to true if you want to skip ssl cert validation +ssl_skip_verify = false +# set to the path to your root CA certificate or leave unset to use system defaults +# root_ca_cert = "/path/to/certificate.crt" +# Authentication against LDAP servers requiring client certificates +# client_cert = "/path/to/client.crt" +# client_key = "/path/to/client.key" + +# Search user bind dn +bind_dn = "{{ grafana.ldap.bind_dn }}" +# Search user bind password +# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" +bind_password = "{{ grafana.ldap.bind_password }}" + +# User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)" +search_filter = "(cn=%s)" + +# An array of base dns to search through +search_base_dns = ["cn=Utilisateurs,dc=auro,dc=re"] + +## For Posix or LDAP setups that does not support member_of attribute you can define the below settings +## Please check grafana LDAP docs for examples +group_search_filter = "(&(objectClass=posixGroup)(memberUid=%s))" +group_search_base_dns = ["ou=posix,ou=groups,dc=auro,dc=re"] +group_search_filter_user_attribute = "cn" + +# Specify names of the ldap attributes your ldap uses +[servers.attributes] +name = "sn" +surname = "" +username = "cn" +member_of = "dn" +email = "mail" + +# Editors (RT and technicien) +[[servers.group_mappings]] +group_dn = "cn=sudoldap,ou=posix,ou=groups,dc=auro,dc=re" +org_role = "Editor" + +[[servers.group_mappings]] +group_dn = "cn=technicien,ou=posix,ou=groups,dc=auro,dc=re" +org_role = "Editor" + +# Viewers +[[servers.group_mappings]] +# If you want to match all (or no ldap groups) then you can use wildcard +group_dn = "*" +org_role = "Viewer" + From c7f94b54c8b9402022824a539780b7aa086bba22 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sat, 27 Nov 2021 16:44:54 +0100 Subject: [PATCH 2/5] grafana: validate gpg key --- roles/grafana/tasks/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/grafana/tasks/main.yml b/roles/grafana/tasks/main.yml index d20b847..f113cba 100644 --- a/roles/grafana/tasks/main.yml +++ b/roles/grafana/tasks/main.yml @@ -11,7 +11,6 @@ apt_key: url: https://packages.grafana.com/gpg.key state: present - validate_certs: false register: apt_key_result retries: 3 until: apt_key_result is succeeded From e2acfd4031fd736f68154a2a4038b11c131a9eea Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sat, 27 Nov 2021 16:45:09 +0100 Subject: [PATCH 3/5] grafana: single quote LDAP password --- roles/grafana/templates/ldap.toml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/grafana/templates/ldap.toml.j2 b/roles/grafana/templates/ldap.toml.j2 index ce97e46..e80c8be 100644 --- a/roles/grafana/templates/ldap.toml.j2 +++ b/roles/grafana/templates/ldap.toml.j2 @@ -24,7 +24,7 @@ ssl_skip_verify = false bind_dn = "{{ grafana.ldap.bind_dn }}" # Search user bind password # If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" -bind_password = "{{ grafana.ldap.bind_password }}" +bind_password = '{{ grafana.ldap.bind_password }}' # User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)" search_filter = "(cn=%s)" From fdfed1a05a7eb4aba8f8e6b36336bcbd0645b877 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sat, 27 Nov 2021 17:02:04 +0100 Subject: [PATCH 4/5] grafana: remove trailing lines --- roles/grafana/handlers/main.yml | 1 - roles/grafana/tasks/main.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/roles/grafana/handlers/main.yml b/roles/grafana/handlers/main.yml index 942149c..cbd4ffd 100644 --- a/roles/grafana/handlers/main.yml +++ b/roles/grafana/handlers/main.yml @@ -3,4 +3,3 @@ service: name: grafana-server state: restarted - diff --git a/roles/grafana/tasks/main.yml b/roles/grafana/tasks/main.yml index f113cba..e0666cc 100644 --- a/roles/grafana/tasks/main.yml +++ b/roles/grafana/tasks/main.yml @@ -109,4 +109,3 @@ enabled: true state: started daemon_reload: true - From a791cda6527d3cb13eeb072c620197b6ed9ccacb Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sat, 27 Nov 2021 18:29:05 +0100 Subject: [PATCH 5/5] grafana: move Aurore specific variables out of the role --- grafana.yml | 5 +++++ roles/grafana/templates/ldap.toml.j2 | 14 ++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/grafana.yml b/grafana.yml index fedc0c2..df5a984 100755 --- a/grafana.yml +++ b/grafana.yml @@ -15,5 +15,10 @@ host: "re2o-ldap.adm.auro.re ldap-replica-ovh.adm.auro.re 10.128.0.21 10.128.0.149" bind_dn: cn=grafana,ou=service-users,dc=auro,dc=re bind_password: "{{ vault_ldap_grafana_password }}" + search_base_dns: "cn=Utilisateurs,dc=auro,dc=re" + group_search_base_dns: "ou=posix,ou=groups,dc=auro,dc=re" + editors_group_dn: + - cn=sudoldap,ou=posix,ou=groups,dc=auro,dc=re + - cn=technicien,ou=posix,ou=groups,dc=auro,dc=re roles: - grafana diff --git a/roles/grafana/templates/ldap.toml.j2 b/roles/grafana/templates/ldap.toml.j2 index e80c8be..7e637f0 100644 --- a/roles/grafana/templates/ldap.toml.j2 +++ b/roles/grafana/templates/ldap.toml.j2 @@ -30,12 +30,12 @@ bind_password = '{{ grafana.ldap.bind_password }}' search_filter = "(cn=%s)" # An array of base dns to search through -search_base_dns = ["cn=Utilisateurs,dc=auro,dc=re"] +search_base_dns = ["{{ grafana.ldap.search_base_dns }}"] ## For Posix or LDAP setups that does not support member_of attribute you can define the below settings ## Please check grafana LDAP docs for examples group_search_filter = "(&(objectClass=posixGroup)(memberUid=%s))" -group_search_base_dns = ["ou=posix,ou=groups,dc=auro,dc=re"] +group_search_base_dns = ["{{ grafana.ldap.group_search_base_dns }}"] group_search_filter_user_attribute = "cn" # Specify names of the ldap attributes your ldap uses @@ -46,14 +46,12 @@ username = "cn" member_of = "dn" email = "mail" -# Editors (RT and technicien) +# Editors +{% for group_dn in grafana.ldap.editors_group_dn %} [[servers.group_mappings]] -group_dn = "cn=sudoldap,ou=posix,ou=groups,dc=auro,dc=re" -org_role = "Editor" - -[[servers.group_mappings]] -group_dn = "cn=technicien,ou=posix,ou=groups,dc=auro,dc=re" +group_dn = "{{ group_dn }}" org_role = "Editor" +{% endfor %} # Viewers [[servers.group_mappings]]