From 8d04583f0f6a75c69cd40c483cb8a570f063cf7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Thu, 18 Sep 2025 16:21:43 +0300 Subject: [PATCH] Refreshing Repo --- INSTRUCTIONS.md | 10 +- files/issue | 2 +- files/motd | 2 +- init.sh | 14 +- inventories/group_vars/pvjjk_1vos_niinisalo | 7 - inventories/host_vars/argo.aito.tjas | 12 +- inventories/host_vars/olympus.juva.tjas | 296 ++++++++++---------- inventories/hosts.yml | 26 +- maintainer.sh | 2 +- protect.sh | 16 +- tasks/deployer.yml | 10 +- tasks/installer.yml | 8 +- tasks/migrater.yml | 36 +++ 13 files changed, 242 insertions(+), 199 deletions(-) delete mode 100644 inventories/group_vars/pvjjk_1vos_niinisalo create mode 100644 tasks/migrater.yml diff --git a/INSTRUCTIONS.md b/INSTRUCTIONS.md index 3e192f1..2129b54 100644 --- a/INSTRUCTIONS.md +++ b/INSTRUCTIONS.md @@ -1,4 +1,4 @@ -# Tietojärjestelmäasentajien Infra +# TIETOJÄRJESTELMÄASENTAJIEN INFRA ## Ylläpitäjän ohjeet **Työaseman asennus** @@ -155,7 +155,7 @@ banner motd ^C `--' `-----' `--' `--' `-----' - PVJJK 1.VOS NIINISALO + TIETOJÄRJESTELMÄASENTAJIEN INFRA r1.net.tjas ^C @@ -217,7 +217,7 @@ banner motd " `--' `-----' `--' `--' `-----' - PVJJK 1.VOS NIINISALO + TIETOJÄRJESTELMÄASENTAJIEN INFRA s1.net.tjas " @@ -328,7 +328,7 @@ banner motd " `--' `-----' `--' `--' `-----' - PVJJK 1.VOS NIINISALO + TIETOJÄRJESTELMÄASENTAJIEN INFRA s2.net.tjas " @@ -407,7 +407,7 @@ banner motd " `--' `-----' `--' `--' `-----' - PVJJK 1.VOS NIINISALO + TIETOJÄRJESTELMÄASENTAJIEN INFRA s3.net.tjas " diff --git a/files/issue b/files/issue index b19fff7..96e9ea5 100644 --- a/files/issue +++ b/files/issue @@ -12,9 +12,9 @@ `--' `-----' `--' `--' `-----' -{{ location | upper }} TIETOJÄRJESTELMÄASENTAJIEN INTRA {{ hostname | upper }} +{{ location | upper }} Made by Jääkäri Warén diff --git a/files/motd b/files/motd index ccd7c39..c80c35b 100644 --- a/files/motd +++ b/files/motd @@ -15,9 +15,9 @@ |_| -{{ location | upper }} TIETOJÄRJESTELMÄASENTAJIEN INTRA {{ hostname | upper }} +{{ location | upper }} Palvelimen hallinta on automatisoitu. Manuaaliset muutokset saatetaan ylikirjoittaa automatisoidusti. diff --git a/init.sh b/init.sh index e2a0436..055d5b6 100755 --- a/init.sh +++ b/init.sh @@ -61,16 +61,16 @@ ti-header "Asennetaan Ansible kokoelmat..." $HOME/.venv/ansible/bin/ansible-galaxy collection install ansible.posix containers.podman --upgrade echo -e "\n\n" -mkdir -p $HOME/.ssh/keys/pvjjk-1vos-niinisalo &> /dev/null -if [[ ! -f $HOME/.ssh/keys/pvjjk-1vos-niinisalo/infra ]] +mkdir -p $HOME/.ssh/keys &> /dev/null +if [[ ! -f $HOME/.ssh/keys/infra ]] then ti-header "Generoidaan SSH-avain Infra-repon käyttöön..." - ssh-keygen -f $HOME/.ssh/keys/pvjjk-1vos-niinisalo/infra -t ed25519 -N '' -C $(hostname --fqdn) + ssh-keygen -f $HOME/.ssh/keys/infra -t ed25519 -N '' -C $(hostname --fqdn) echo -e "\n\n" fi ti-header "Lisää SSH-avain Infra-repon käyttöön..." -cat $HOME/.ssh/keys/pvjjk-1vos-niinisalo/infra.pub +cat $HOME/.ssh/keys/infra.pub echo -n "Onko avain lisätty Github-repoon? [K/E]" while [[ -z $SSHKEY_QUESTION || ! -z $SSHKEY_QUESTION && $SSHKEY_QUESTION != "K" ]] @@ -80,7 +80,7 @@ done echo -e "\n\n" mkdir -p $HOME/.ansible/vault &> /dev/null -if [[ ! -f $HOME/.ansible/vault/pvjjk-1vos-niinisalo ]] +if [[ ! -f $HOME/.ansible/vault/infra ]] then ti-header "Syötä Ansible Vaultin salasana..." echo -n "Salasana: " @@ -90,14 +90,14 @@ then if [[ ! -z $VAULT_PASSWORD ]] then - echo "$VAULT_PASSWORD" > $HOME/.ansible/vault/pvjjk-1vos-niinisalo + echo "$VAULT_PASSWORD" > $HOME/.ansible/vault/infra fi done echo -e "\n\n" fi ti-header "Suoritetaan Infran asennus..." -$HOME/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/cwchristerw/tjas-infra -d $HOME/.ansible/pull/pvjjk-1vos-niinisalo/infra --accept-host-key --private-key $HOME/.ssh/keys/pvjjk-1vos-niinisalo/infra --vault-password-file $HOME/.ansible/vault/pvjjk-1vos-niinisalo tasks.yml -t installer +$HOME/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/cwchristerw/tjas-infra -d $HOME/.ansible/pull/infra --accept-host-key --private-key $HOME/.ssh/keys/infra --vault-password-file $HOME/.ansible/vault/infra tasks.yml -t installer echo -e "\n\n" echo " diff --git a/inventories/group_vars/pvjjk_1vos_niinisalo b/inventories/group_vars/pvjjk_1vos_niinisalo deleted file mode 100644 index 4d3d08e..0000000 --- a/inventories/group_vars/pvjjk_1vos_niinisalo +++ /dev/null @@ -1,7 +0,0 @@ -$ANSIBLE_VAULT;1.2;AES256;pvjjk-1vos-niinisalo -37623635363162376361343137303239633766373665356664316265313934643038656535353034 -3562643166633064613064636265366431316264316165330a313133343131643234323066383761 -65313837313461623432643462643465396163313066363566333237663936393432346430316231 -3262626564386666650a303035346537343139636366363438383334336662303364306332623964 -32333834346136363533306534363335386561333532366663326166666131653762353765303531 -6331353865343330306337346138373136636633353565303534 diff --git a/inventories/host_vars/argo.aito.tjas b/inventories/host_vars/argo.aito.tjas index 835e364..5c30062 100644 --- a/inventories/host_vars/argo.aito.tjas +++ b/inventories/host_vars/argo.aito.tjas @@ -1,6 +1,6 @@ -$ANSIBLE_VAULT;1.2;AES256;pvjjk-1vos-niinisalo -62343762666534316333653638623331666135316433623665646138663732386435653761633839 -6132616566626636386333636135646564353261366161370a396636666564613034323331353739 -64616430633430396666373038383239383766376532633965646535386239383962626363646261 -6563396539383263370a353931303465383239313135396564373834373565343662366134393763 -3266 +$ANSIBLE_VAULT;1.2;AES256;infra +37346434333731323663613365373335333165306332343435316232313862383635623437306531 +6463663532653930306564343466306236303539333462650a376635313636313439623632633261 +33316335306266643365653938643933356131396436393832643466383866313630396466636331 +6432643738356130300a663031633433393865636264616338333562623231623030356339316266 +3564 diff --git a/inventories/host_vars/olympus.juva.tjas b/inventories/host_vars/olympus.juva.tjas index 2262291..d99509f 100644 --- a/inventories/host_vars/olympus.juva.tjas +++ b/inventories/host_vars/olympus.juva.tjas @@ -1,148 +1,148 @@ -$ANSIBLE_VAULT;1.2;AES256;pvjjk-1vos-niinisalo -33363831356333653137343362393964373634653530373236623436656434336561616330656361 -6334626339616432613839343961346637646463616532620a666534303332623462336634303537 -66306462333566323532393466393637616466336139343165353865643964356232626532326535 -3131333164346532310a353338336461663532333038653430366133616265353530613838343737 -32613630353233386565396430313839376131613062306430623838353033646133343636666335 -62633861376230396235326364366462316230333261326264623965616132616162643664633732 -36656339656561373763646338616631306631353937663734336366653639383230353136393634 -39653066653334663838656632636365623361663566333036383833356432326464656534633631 -62303464613066633232306538343166643432363430643330353464373831653666303564373733 -36353939303231646666666332663339356665383431313137396466316231636631666565633635 -61663365366162333132613165303662623634373937303263633036303239636665616531343837 -30323035326231343065323764326435653165616637343431373936346266643234383862333365 -31363932613437333737316232363337386366653239656637303131353239306139633330396235 -65353138376130386437376236663333316666613630346637663030393764633231396231613064 -39663337366664623063336263636166373930383032616464313465653130333438643136366236 -31306238333633626630373830366166333364366265626162623433363661363437316361383635 -63616666303665303832363436376637396263303863643334623732623139646335323461653665 -35353365633031373637643433663537636563343931376232623934626364666535353964643530 -62653232613031313834393535313266306237613736383031366232653566363839383435396532 -38363063633364303932336331643832663935643335633737663337656262383961396339316435 -33393831363663343137383737623736616163363165633161383631663633663235396236366462 -30613864613739373830333265333932383230336562383361386663376262323039393439393461 -39313531393233623839653539383265656261646437636461356566643735356336376466373735 -37626364663535316634343063646664653330386666343661346236646461336630666561333331 -65393264656462396162333538643261656433623731383633303139343239316664613634303035 -64663333646665363438303165356336323236666566383634313238346463316161363338363465 -35333036353964333265626133643230313332613331633533623933323631326636656266333436 -36393336613365343133626135613439376535656134376331333232663439313436393739313037 -37316130333936343464643161623561346237663666643734633361613132393366393833653238 -62333638613730323164623536393437343036383134313465356334306662646361303764613464 -62366536326139623334633064333531346161376433326434353562353836663466346337316165 -65613032313162393331343066613337393737373532613531386465353266373162336164323764 -66333365333366356636333066663435333065333362383035316439343862393334383239363333 -37353865623037373962623738353034353762303836383335353630643730646565313033356135 -33373037646337326665313063656430303462373631386137666438323630383533313465333862 -36373839306535353138353864353761623331373836333164303032303631333438323564633064 -37326162613764383233386661613534623535383330343036353566646139653933383232623663 -36326134646238626534663634393538663061316330643435376135613330393932386532616232 -64373832343538366263396261333137366139353732353962306263383931343931393761663164 -39366561643561333831353432373333636264343564343534333262663936353064666338623535 -32656562363765303639396139346261396662306661623263396630393734323161383730656261 -36336235623266316236643236663535666664326535363936313539343232643736626562316639 -38656136623362623338373336353039333365333937343962666166623962326365333966633461 -30656563323831353532643837633862333663356532313964313234646237376638346332393964 -34396435306262663931613366346363343437346661633563386336643637303163376562623533 -63386438386435663133333639363763393838393837346133383134303733303662336266653662 -32306237353332376466326463656638613965366564316139343938343263353730656466653736 -32663838306435643638343637363537623363313065383738646338313333363733653730393232 -30333831386330303862383965616464313966653031373132323066393136613831396266386331 -37303830626138393439393534646536363466653431316535653165386465303733333130323537 -61363065376230323831313637653733363232633865393435653763306638383132376133373833 -30646539343465656638323839363932613532333364626535653233383165643336346338356563 -66366136643866356539663936633665313164646130346666373233326561633164356565633665 -64646331353662376166383831396534623736363938343639303336313063393665396365666461 -37303031316364653064316535623039333763643435313434666436613035316561333138623963 -61633164663130633335303766646330666666363737346432306339326131623339316562306339 -37343330373163316461666537623862333437323132633633396636363737303639653165353566 -63373262616265353332343534613739663064623563363532633338636461353336656136306137 -34393034303239383230633963646265313663303865663134313736363838613937303337386537 -34396138333234343034396238376461626531313233386462366365306163316336323739363565 -33376563616136333236646263373663323131666165626235323039663634373662316563666363 -38656665636335396464313365623135323738363430616430663133663535623932313364333530 -34303361356233383736663432626263383164303335326537353135346364383065343763646538 -36656330376339623266653735376361383732666637333730323034653664643463346636633863 -36633036393531306630346132653839636263373063303934663439353236616536626334333766 -63343335316532613037636562323735636632393330313738323063346632303033383865366334 -31386637306463333932666236396466643965306532303963336437613837316264303866636631 -36373032373030656332343736343561346161383435633330303639666364653762393738333461 -35323633356534636437326266626265633335366165336331383138663837313333643761646636 -63613936316132363266383061613239623964646631303063396436373866356239653835363933 -36356361613362626265643762643830626138376165313731366635646333323763626362653665 -65663166376236373438363531653939393735653831326361633562623835623833653266613032 -37633761613633643934316233313934376239613933323164366661356634383832646533393861 -34666237663065333133316536646463653264653061363333623035373762386631613438326262 -33376364653064656165346166636562656438393531643535363137393339346562396631643463 -64643131303037616530363536353938383531613937393337346462653234663663386139326264 -37353837633430376438356238356565613235656166623335383931666339623233623863623861 -31393363326165313933303565623564376633383636626636333964343566323030396330353230 -63383164313235353463633134356339383233616166383731616631363636356131616234666662 -66666337373731306233643963626166653334636563393839626539346633313133613938363338 -34633333333738393631346563383932326564326561333834623232653236386663633931383332 -63376363343130636562373130366334363365306661363834313466313537303666306364643163 -37666662323964386635623662323736313262333231313230353534613839326462386463653933 -66613363643565306362363735383861656238383863383535663233326665643938316230323063 -33386433613961366137626631303939363066343535303462336331313139633562663363333665 -36306634356466373662633534643731656235353866343233346435373338306439303966343534 -63316336646538613038633335616464623636663030346238393036646532636432393339633865 -36366231623732376539333835323538303435663461373065373161303861386331666666363834 -66346136323334656365396635303832623564663238323964373863616365366266343563316136 -63363762643336656539303532336538653365323131623465633331623334623831653839376135 -65313037346430633032363063386537396261316262613037623161326136323930356335613836 -32303733623663396230363432333137626435333232656265613935653339643865376633613239 -65353638663332613863333331643433653864316565386264313665343165663334303036303331 -38323036366565633234336265616532323837363464346530383362646631623835613566326561 -66326633613333353738376666363034653736343431356430656331336436373866623734386464 -61323835626464323766353233383135633263326338366639393266623533336366636531326166 -36386566316439633666666330303533363861353434333939383838656462623863323537656337 -39353264396336666664656461336564306366646635636561663533633234626565316666646130 -65643334393963613236623134616336643362303562636361633438383430633438356332313830 -30636531366432613237656535383934366161313661643966393739653932333235643933613865 -65613662333639306430643939353133623463373739643833386236653166303433313233366135 -30333963333331336531643336393837333332646130656630616165626161306530383934353536 -35386337373539343165363832383536346466653666393532653633373030343566323365353665 -34373136393034366133316334393332656362623437633437636630393636363366366131313730 -62623035646234303532663239373262663338383636613931616230643464383233373035383632 -66303139643139316535383234316462656431663731326464336434666231336262656536336139 -38366664353763343038313236613834636262306635633463373437633136336131616534303636 -34333863396564346664386130343430666361613461343439333138633433353136383439373437 -61393636313035346537313331333037633633663039376263366432633338366238626231303434 -39663136306564303938353736393131363338323234386630393032633831396664383938303561 -34333536333066383135373138663662646161343130663836303031363965366337393237653134 -61386239333766323664373631616138653538643331656338663432393333356461363933353866 -33643334313863653261326661613538386666376330633530666436373436373435333861383436 -62323232393633656538613465663864353263633937313632353133393435396265396334636465 -35623861366166316664326362313534363137313438303561353730356439393566616231646133 -61366539663237376535303135313466646662306137373338383634343766656535393365343933 -35633830663933663439323266306536313238353338656564356365626664643532373965303863 -62633463666238313531653234383934396334623061613964306464313033616133633335373063 -65343133623335663732623834626530326339376534323632653230383364643661353734623764 -62343633663733306334336466363564343137306664316365383131633732643439303239393564 -36633466373732623065386135323230306335396131343734626334363139643735393936643739 -31623536313830313139633236346166643039663638623363343666353465393733383461613464 -64326465396432633038616437653032386637336562613065356133663037653133643231613965 -32333466363263663935303264353334393938616564633132663539306137373461373730656365 -30613766316535343162623163366664396438636135613861333232646232623733643538323766 -36626539616665343061343465353361623432323661343938626234393237316238653035633331 -36616364326434613332376132633433363336393563653361323039303538366134303434396632 -37303837393566336238306137313864646232346232656135633466643830663839623433613736 -34666334393938666636643465393563376233333836313138623034393539646436646430323533 -37393563346231366266393530326130666334626232373736626563393363326161356537373036 -31646464636239373332373735376462393334636264333064323030363834306637623062303461 -35646161316363306231356537356263343166353336373932306438393734643561663061623964 -38396264306366326638363761313862356166396466393666323738626565353662396661396633 -33633436373866303036303961656364623531323636623135346637373466353236326366653662 -32336535633564643130626266643730636133636539643661613063656233626530303439626563 -62326439636437396133303161316434666266306538633630346538383662613733363730353363 -36336137613961653765383033653335333336303834643363336639633231393461643264646333 -63303464323264313466623862323835373337366434623230383035633964303635643133656262 -34623065383164363565323064616230623539313064313035656635373433633661303362393137 -31316238313136353166313237653766333539386438323065666632636338616234663039376537 -37313734363333663136356539306237393532383533356463353435633131363264393637323239 -61653964396364616335313037643262663930393262393136316234326334656366383636643037 -35636138333238363234633966303832363138316265336337353333366362393033323731336337 -30333666373662393864633430316532343533333935633630363861633165613162663436336130 -32303337326633396264643434653733653764383265316236393364663431323135653130636535 -32343934333266316235626331653334613031303761343864386239663233636134303438363337 -616365306531626431343532356262356262 +$ANSIBLE_VAULT;1.2;AES256;infra +66323263653830373236363236663539393430656663356266613864333262623035353165373165 +3239613965316461313062353738633734643631386339650a663465646165376430623963383439 +62666366633435653864306364636432663965623334386666366132373439316466623135383736 +3435626231313834390a623537343764663235656562376361303137653864643562636436343465 +34393862633566363462613665613632313935353663313033316538623466356637386337643662 +37633232653932653030363762373139633761303362326163323666363738623863373932613462 +37613031333461646363633534366237383031353330316165653136376163636262616637626539 +39336436663738393034303436666432363630316636316237663663303737306166316230353664 +63666136376164363232636330386134323735303266636566373139313265333335343433616664 +31353166643539376338396165376461393935383231396237376362663561393161633661303438 +62383062646561346431323136323963353465323361353161653566316165616532353766313164 +31633136366139656364643139363934373631336336353032646233316236376162303737623461 +66386261633863333462363163383633646661346262336638343035326363373331373365633035 +38613263303466333764313463393832333439646534373564356237623232363335356435653238 +64356465353538643163643833346538376166343562363935646239373863363061363563633833 +39303663373832343664666236356161666331616661353966313938303233316438373337336338 +38356334316238326534356262393432393432636632663965363463316439383133323562366666 +63306633393231646363373932343434313836383633326437303431666262646661363361623162 +38616333623838663566373531643866653664316534326133313339366434346530343130633831 +66343561643861303438343835343935633333303961306561666164333736323466623662386332 +36383530663265376366366665383637656362353235643165313936393131663636363161356365 +37653264323366646534343731393433613235613266636538623538636166316439333061303765 +39636466363963663664636237646661623866393636386538633562313437663066323961343166 +32313466363238373531313531613834373531663732373963343832616633346431353234616662 +39653863336233663934663830643935383763373762393438313463373465316239356639373763 +39656134663765333538626532376433623466366161636563346364353631383364366262386132 +31316435316637613635396635366339613263353463626631356433343464326565393334363930 +36306339633132646161666233313638386234326566623633363633646139393636363130383366 +31616166366664326464346138646635303664633366306333303465646237333163626663343133 +33383339303431653132663937656634333566613835616536613361336231333933376664656265 +36306662396239363662633832666165356361366163363739353337393235346562343336633138 +63353364666131653535653430396361633130393130353035363733346238396165653066636362 +32373634393034346466396439303365303962376164383030626532343339663863376366373163 +64326262313634613832353633623663656235303366356261623531393135386230656561383038 +34663536343339663435313465613131616665646133656463626132303139303361303531666636 +36303566643161366230343739326563663165653338623234643332323565326636383334616137 +63623263303861643266326565336261613934616432623031636430396333613830323761623732 +34383162613732363930366132373038313735636266623737613262383132373265376661383865 +65663831343137333438643961646232366435666134353863613932633465313264316163666234 +33653038323733333663383735323238373536333535313166353939636634653464656262626431 +66326539316633323634343366663666386566353063663531663037323964303265623034326266 +39306630386330653138376138646265633833626365313566346365666466636537666436346463 +36366166383333633865373764653838313838623131643662646166646337306233663235356633 +30383833333438616536636665396339316639353539356339373133323439643636376134306130 +64303734343665656436343964353937646334333733643365396631313538636533663138363865 +63363932396431356234653062633636393831636334303030326130633133646133303739623463 +63373530323735613138333336323435396433623634653664666438343135643261323730633432 +64626166653438363434663133613631393939373438326337326438336263393538336362656138 +31386531323530303864313763376363343035633834393661383835643738313439636436303065 +31313665356333636363363939656536313066393666303364373437663433376164313966663431 +65663734626132376266623435353939643934316533333034326538626336656337323435356233 +39383565376534666663356166366165646634323162316131303065313438373632646635373064 +38363163323938353339326537353465373335383539353932336137343534626630663265393863 +37656265373937393632623265336365633739613963306135623036313934653537643166613737 +39376337656132376539393432613064613331316265656537616437373162316132613762626165 +63633732306439303239613636363137393364656436326138356132366336353838626464363139 +39623865393338336461323137336437616362303362636634636163646563323563356239613761 +62636666343533323432643132306564316161613364633538356131366335613662623537316339 +39613132666532383438393830633232393435333262633066616663343833326465663331376235 +30316539316131316634326138333865646662333232343263353939656533336362636363303166 +66386236663638613237626230336464343236343666333739666366653631633037373931666433 +34383137383733626431633433393135306562373935613263396535616661613839396163373464 +39343430353531343962333466643833343866373531343661346237663233613637323739623739 +38613236383537626234393932653239353836383732623537633863393561373962623239626561 +38643761303061396633323061373637613462383837393638353030646362636136663534343239 +64646237623462373232303338623064653065663039343164333761383730656235306366646436 +65303064356130613533323730366536376366333134663134373733343863383431383332646238 +31316662643636666365336230666461393238653535396463383765306437636133346162643035 +33363137343363326638353634663266396330373662626563656563643762383863333136363633 +37373635356665353036643761326636663130343761383733646536343065643731633364343063 +38396135386633393762646664336239656565636334633765626134383132646537366432326438 +33316638386430623935353864386562386234333061656465616463373430383735323933643838 +38346162396130303564336261653831343462346466316666353633383636633330346530656333 +64353063653563666663326662323738353331356165343839376666616235393362313333613466 +64373465303132326661343039623031663263656638393131363239313235373931306562646332 +63613231643932346661313365363766383065633161336264303761396336303934343362623836 +39313535366538383032356461326461666232626562303462386639363434363035333530373161 +65366139303936383936663630623037333839613138626532643637646138623263306663333139 +38653232343234663665616461376234626163363466373437316561383264633934343837623164 +66643966313338313338366431333263636437623730376530323032303735393365316565636636 +36346538376338306331383535363435616638386265383334363536656231646330373335343636 +63613962616333643935303939663364363935323639343539393530653836316636643339363331 +63346632613962363962393835393935656363663838333466363064666639623364653962323865 +37383364633730616439666236626633643639643832323938396661333931653763663739653365 +38326236386130373731313662306336346463613437326433343336386633313261383234386236 +63393132363030343338663133373466363738663539326238636132376137353264663731643738 +64666235613937643064666638346361303236653765653666316131373132643034353061633630 +61316135343830343938336464346330373761383632653737663861333836643337633039326332 +65656365366563303037366263306261343662383637303830306465643765663136346639313439 +36653432396234373532366236326530613136666463623037323162366662643235316663613839 +39363734303838393365643832643534643235616263303464346636643335303933613038393663 +33643661316562336535613231343631353039393832386338626334646563393930333561623538 +30346133356566646664393738366431613264396564386333323966656165376566393930303239 +62366530353137326563653430396637383765303232343832653664613834343262313235383335 +65313235663738663433643335376533646261336535636139623037393962653435613137663533 +39326238653738613039313735396666646132376639343534643834626561613863613138626334 +66353233306633333034323463303538643166633661633363636634613166346663353939626265 +35306464323462666435623330376339336436343263336437663763613464386131656262396437 +32303536343138623531396637333537366566666564363334643531363965383765633439633563 +35656239656435373663346461343234363661383265303666373939393265363263393634653638 +38323961636162336137643735333163353831366464663034623565316132393131656636656366 +66333935343934653532393132643732656263356366386632386161343034653362343935633539 +33363537353030346564336433643338616535643763333363366462376463653137386239633537 +34646562636134323964326632653466336663633065386636316238386135336262666131363666 +37333035366366623561343065646637613261643063376231356365313739626539316332643733 +31353536306162393236376639393464386232393734343735333665663133376233346434333161 +35643835373162383139386266396463376163666435353733633133656265613339303536656431 +33353033643062333135613031316633633965376637393833396264656336353431366364623365 +32333764656564323264313031613736306163303038323339386432646363323738333363623762 +33386362656361353436626337666138656639613136646331396531313364653331656563393931 +61633961633934346533333536313063613764326237313163353463643766363465356337366562 +64633465306232346130396338623530303033636535363635653131633035333638623134633035 +33666635303939383130353064373565613134633162336637383661376465373032306131643239 +65313633626636363034333936646137636336636166333536343833656563656339353437373833 +35643766633134313330333238393664323932303030643532313139313035316365353733333433 +31366266303362346338323262383439663530373130356130663038613465346432666461336632 +36386435666237333738383864313765363130666433383966313832643961373164633535393234 +34646162363062613563633165313262313534383138633862363134356337343836376564613138 +62663437323936393832633536303833646361393839323763623666666361363737653030326166 +33636362366561613837376365386431626665373864663931643462646139666466323939656662 +63626561633737333466316433323939383365393636653762323233373031666462303134656564 +33306539303138383562353532663333333739633061613031366264383933383833326432363039 +35383036353031656230646565346666633663663635343564643331363934303662306465323030 +62356666303763643536313264616133313165383432336563656439323139656339393564366438 +36326538383862313737346131346462363264343338626462386563323530373732393336306262 +61373037616162356665316536393234343861333462613934626533323238373232666262323861 +66383039626131386466373734643463353863393035376365376136303466333234643539636466 +30323735393234643632393238666635643466383163363165636433343432363730373434636262 +39663633353133346561643463383461623831616666363536343261353639643166386565336432 +37303839656137306437346437616339356339663239656231386232633764646264653334613762 +30313333376335326166353334623336653833393166396130613266343763383764393237376161 +34386431666438313834636138303430396332373830636661393432643464663066623437666439 +38633535386461646335336666376163376266656534313730333866333036613132616166623338 +33343133396462316666336664343266633930613833306331333161383632363534383736333637 +63336661636539666661383939633134663931656661383137376432343030333730363438323133 +37393337356234353935633665343032623436346637646264646436663564613034373831366331 +64353331323463646235646562346234323335386535313833666139666231653830393937383439 +31656536613564316334643765626464316264346137313539646438343639633763343266613338 +62353862353234646364383762626462306364313334396635623961663566366634363834323962 +33323034346265396133613135643635623633633934356561366266306336323366613333373465 +65643031656539333631663665396433303931386432356638636264303334316365323665636265 +38393237313336333130646630383638303830313932363236656165383532323161376636356138 +37633939666565343136653234373236616365623736646334636531393661656633303435623431 +66353730626236616230313865666234333865303736396231306638343332346339333834353538 +33343431643139653934343838366138346364633932363231366434343363666132373630626330 +39316432363936626232373535633363643538626230326666353966326231363132383133646236 +363635336431323162633239393562623631 diff --git a/inventories/hosts.yml b/inventories/hosts.yml index b218f59..4d39a67 100644 --- a/inventories/hosts.yml +++ b/inventories/hosts.yml @@ -1,9 +1,17 @@ ---- -pvjjk_1vos_niinisalo: - hosts: - argo.aito.tjas: - hostname: argo.aito.tjas - olympus.juva.tjas: - hostname: olympus.juva.tjas - vars: - ansible_python_interpreter: /usr/bin/python3 +$ANSIBLE_VAULT;1.2;AES256;infra +63393564633938366631613466653062643963353265373536633864643366613232373731376433 +6333616239646333346331643831393830636134353465360a396431626662313831313331666161 +31343439373039623330656437653964326637633330383261663165316430386564613534633161 +3031323966313030350a666630373139383836346161313232386235306235656161643834396339 +65663138333037396163336163353634363239643261623630333162313737336265343661336435 +31366162313137313266316462636262613630373464393736323361356238353765643039346563 +66626338666430393733303038616434353337306632623665646432323166336165326663303032 +38373336326565303832383536623337346465633335386531633365616565393635383631643038 +39623663353736343638613538616530353964383765333430383337646664343230646438623231 +37376539623364633563373039383636626363373861613862303566646336633730353661643265 +37663631633934656132396363646430313363636463613936386435663933613339386166353264 +35616438663262366337326361373961666539333135663833346636383961326635373531653735 +31616664353362383532353866336237313439616237353835653662626537346232343131323334 +31633263353739303562303537636566326161656166633766393762323539396634343632626335 +62643639333138373565303261613062313435613837616665613037336566306561646361383337 +61306633306132363739 diff --git a/maintainer.sh b/maintainer.sh index 4058625..1055bcc 100755 --- a/maintainer.sh +++ b/maintainer.sh @@ -18,7 +18,7 @@ echo " \`--' \`-----' \`--' \`--' \`-----' " echo " -TIETOJÄRJESTELMÄASENTAJIEN INTRA +TIETOJÄRJESTELMÄASENTAJIEN INFRA MAINTAINER SCRIPT " echo -n "${normal}" diff --git a/protect.sh b/protect.sh index 7ed93dd..8600ec3 100755 --- a/protect.sh +++ b/protect.sh @@ -18,23 +18,23 @@ echo " \`--' \`-----' \`--' \`--' \`-----' " echo " -TIETOJÄRJESTELMÄASENTAJIEN INTRA +TIETOJÄRJESTELMÄASENTAJIEN INFRA PROTECT SCRIPT " echo -n "${normal}" action=$1 encrypt() { - execute "ansible-vault encrypt --vault-id $1@vault/$1" $1 + execute "ansible-vault encrypt --vault-id infra@vault/infra" } decrypt() { - execute "ansible-vault decrypt --vault-id $1@vault/$1" $1 + execute "ansible-vault decrypt --vault-id infra@vault/infra" } list() { i=0 - for file in inventories/$1/group_vars/* inventories/$1/host_vars/*; + for file in inventories/hosts.yml inventories/host_vars/*; do i=$((i + 1)) echo $i")"$file @@ -43,7 +43,7 @@ list() { execute() { i=0 -for file in inventories/$2/group_vars/* inventories/$2/host_vars/*; +for file in inventories/hosts.yml inventories/host_vars/*; do i=$((i + 1)) echo $i")"$file @@ -55,15 +55,15 @@ for file in inventories/$2/group_vars/* inventories/$2/host_vars/*; case $action in encrypt) echo "${underline}Encrypting...${nounderline}" - encrypt pvjjk-1vos-niinisalo + encrypt ;; decrypt) echo "${underline}Decrypting...${nounderline}" - decrypt pvjjk-1vos-niinisalo + decrypt ;; list) echo "${underline}Listing...${nounderline}" - list pvjjk-1vos-niinisalo + list ;; *) echo "${underline}HELP${nounderline}" diff --git a/tasks/deployer.yml b/tasks/deployer.yml index 08c103d..f003005 100644 --- a/tasks/deployer.yml +++ b/tasks/deployer.yml @@ -1,4 +1,10 @@ --- +- name: "Migrater" + ansible.builtin.import_tasks: + file: 'tasks/migrater.yml' + tags: + - migrater + - name: "Deployer - SSH - Add Authorized Keys" ansible.builtin.template: src: './files/ssh/authorized_keys' @@ -68,7 +74,7 @@ - name: "Deployer - Yggdrasil - Build Image" containers.podman.podman_image: - name: pvjjk-1vos-niinisalo/yggdrasil + name: tjas-infra/yggdrasil tag: latest path: "/root/data/yggdrasil" build: @@ -79,7 +85,7 @@ - name: "Deployer - Yggdrasil - Run Container" containers.podman.podman_container: name: yggdrasil - image: pvjjk-1vos-niinisalo/yggdrasil:latest + image: tjas-infra/yggdrasil:latest state: started recreate: on network: host diff --git a/tasks/installer.yml b/tasks/installer.yml index a10d7f8..36a0d96 100644 --- a/tasks/installer.yml +++ b/tasks/installer.yml @@ -247,17 +247,17 @@ - name: "Installer : Schedule : Maintenance" ansible.builtin.cron: - name: "{{ location | upper }} - Infra - Maintenance" + name: "Tietojärjestelmäasentajien Infra - Maintenance" hour: "*/3" minute: "0" - job: "/root/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/cwchristerw/tjas-infra -d /root/.ansible/pull/pvjjk-1vos-niinisalo/infra --accept-host-key --private-key /root/.ssh/keys/pvjjk-1vos-niinisalo/infra --vault-password-file /root/.ansible/vault/pvjjk-1vos-niinisalo tasks.yml -t maintenance" + job: "/root/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/cwchristerw/tjas-infra -d /root/.ansible/pull/infra --accept-host-key --private-key /root/.ssh/keys/infra --vault-password-file /root/.ansible/vault/infra tasks.yml -t maintenance" tags: - cron - name: "Installer : Schedule : Deployer" ansible.builtin.cron: - name: "{{ location | upper }} - Infra - Deployer" + name: "Tietojärjestelmäasentajien Infra - Deployer" minute: "*/5" - job: "/root/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/cwchristerw/tjas-infra -d /root/.ansible/pull/pvjjk-1vos-niinisalo/infra --accept-host-key --private-key /root/.ssh/keys/pvjjk-1vos-niinisalo/infra --vault-password-file /root/.ansible/vault/pvjjk-1vos-niinisalo tasks.yml -t deployer" + job: "/root/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/cwchristerw/tjas-infra -d /root/.ansible/pull/infra --accept-host-key --private-key /root/.ssh/keys/infra --vault-password-file /root/.ansible/vault/infra tasks.yml -t deployer" tags: - cron diff --git a/tasks/migrater.yml b/tasks/migrater.yml new file mode 100644 index 0000000..7594e18 --- /dev/null +++ b/tasks/migrater.yml @@ -0,0 +1,36 @@ +--- +- name: "Migrater - Copy Secrets" + ansible.builtin.copy: + src: "{{ file.src }}" + dest: "{{ file.dest }}" + vars: + files: + - src: /root/.ssh/keys/{{ location | lower | replace('.', '') | replace(' ', '-') }}/infra + dest: /root/.ssh/keys/infra + - src: /root/.ansible/vault/{{ location | lower | replace('.', '') | replace(' ', '-') }}/infra + dest: /root/.ansible/vault/infra + +- name: "Migrater - Schedule : Maintenance" + ansible.builtin.cron: + name: "Tietojärjestelmäasentajien Infra - Maintenance" + hour: "*/3" + minute: "0" + job: "/root/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/cwchristerw/tjas-infra -d /root/.ansible/pull/infra --accept-host-key --private-key /root/.ssh/keys/infra --vault-password-file /root/.ansible/vault/infra tasks.yml -t maintenance" + +- name: "Migrater - Schedule : Maintenance" + ansible.builtin.cron: + name: "Tietojärjestelmäasentajien Infra - Maintenance" + minute: "*/5" + job: "/root/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/cwchristerw/tjas-infra -d /root/.ansible/pull/infra --accept-host-key --private-key /root/.ssh/keys/infra --vault-password-file /root/.ansible/vault/infra tasks.yml -t deployer" + +- name: "Migrater - Schedule : Deployer" + ansible.builtin.cron: + name: "{{ location | upper }} - Infra - Deployer" + state: absent + +- name: "Migrater - Schedule : Maintenance" + ansible.builtin.cron: + name: "{{ location | upper }} - Infra - Maintenance" + state: absent + tags: + - cron