summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradmin2023-12-18 23:17:41 +0100
committeradmin2023-12-18 23:17:41 +0100
commit2adc886e5c0c72b8c6560050c4edd30ea9fdbb56 (patch)
tree82355ec311bf14bdcac403834be313d8a368c6c1
parent64dfd20134ee028cc865745d8d8bfec31299ff0a (diff)
downloadansible-2adc886e5c0c72b8c6560050c4edd30ea9fdbb56.tar.gz
add role for mostdiscussed.com
-rw-r--r--ansible.cfg2
-rw-r--r--roles/common-linux/tasks/main.yml5
-rw-r--r--roles/mostdiscussed/config.json8
-rw-r--r--roles/mostdiscussed/files/config.json18
-rw-r--r--roles/mostdiscussed/tasks/main.yml40
-rw-r--r--roles/packages/defaults/main.yml2
-rw-r--r--roles/ssh/files/config4
-rw-r--r--roles/ssh/files/git167
-rw-r--r--roles/ssh/tasks/main.yml32
-rw-r--r--site.yml20
10 files changed, 297 insertions, 1 deletions
diff --git a/ansible.cfg b/ansible.cfg
index 75bd619..4c0347c 100644
--- a/ansible.cfg
+++ b/ansible.cfg
@@ -141,7 +141,7 @@ log_path = ./log/ansible.log
# If set, configures the path to the Vault password file as an alternative to
# specifying --vault-password-file on the command line.
-#vault_password_file = ../.vault-pass.txt
+vault_password_file = ../.vault-pass.txt
# format of string {{ ansible_managed }} available within Jinja2
# templates indicates to users editing templates files will be replaced.
diff --git a/roles/common-linux/tasks/main.yml b/roles/common-linux/tasks/main.yml
index f0319fb..35d9fde 100644
--- a/roles/common-linux/tasks/main.yml
+++ b/roles/common-linux/tasks/main.yml
@@ -22,6 +22,11 @@
- import_tasks: ntp.yml
+- name: mkdir ~/code
+ file:
+ path: /home/horus/code
+ state: directory
+
#- import_tasks: cronjobs.yml
diff --git a/roles/mostdiscussed/config.json b/roles/mostdiscussed/config.json
new file mode 100644
index 0000000..dae31c8
--- /dev/null
+++ b/roles/mostdiscussed/config.json
@@ -0,0 +1,8 @@
+{
+ "DB_Host": "192.168.122.1",
+ "DB_User": "mostdiscussed",
+ "DB_DBName": "mostdiscussed",
+ "DB_Password": "fda08915484855cc4f5198dae6e1af6d2d430927",
+ "DB_Options": "parseTime=true&loc=Europe%2FBerlin&charset=utf8mb4&collation=utf8mb4_unicode_ci",
+ "Debug":false
+}
diff --git a/roles/mostdiscussed/files/config.json b/roles/mostdiscussed/files/config.json
new file mode 100644
index 0000000..ff56feb
--- /dev/null
+++ b/roles/mostdiscussed/files/config.json
@@ -0,0 +1,18 @@
+$ANSIBLE_VAULT;1.1;AES256
+36663134323962383562656462313365346364396563376465333534656265396235623730393335
+6363326237663266383633623633666434323664303634330a653332366266326538333365386535
+34326532323038313662343132333561303031373565326164333235653831356363636233326532
+3566323530336264640a333633656263393662363662646639323365643662386366623431306336
+31313962656532363237633536636436313535353337333532343633366564316564643135313530
+37643838643764383862373862336563353539336663333164633163613936663138653765303334
+34626264373538663635653430373565356465353461336538303138633332663432663034636133
+64613965653734666538666264613764313931633761393664323763633364323563383166333066
+65396439333230613333353133336532616130393866653864333965636562653737386562623934
+31303936313536333630633338626362393638636438626137653032303039356661323834313435
+35393631383065393165313861356237643931346338303638333062646338666630333430336434
+38303665333836646665666165633565383663666662663838383631336334623739376539643334
+61356561616239343063376630633461333437336638333532656434306331636361313864386431
+31663939386266353031323337666366333639396361386439336462653064356638383766396265
+33343362613166663661613361326331643336303636363134336161356561616336623262366133
+37343665363662643630396138363532366433396132376361353739313131353061666230633137
+34653730366536613938373263356231323039656433323139333463643133356565
diff --git a/roles/mostdiscussed/tasks/main.yml b/roles/mostdiscussed/tasks/main.yml
new file mode 100644
index 0000000..64109fa
--- /dev/null
+++ b/roles/mostdiscussed/tasks/main.yml
@@ -0,0 +1,40 @@
+- name: git clone mostdiscussed.com
+ remote_user: horus
+ git:
+ repo: git@git.iamfabulous.de:curious-web
+ dest: /home/horus/code/mostdiscussed.com
+ accept_hostkey: yes
+ #ssh_opts: "-o StrictHostKeyChecking=no"
+ #notify: restart nagios-nrpe-server
+
+- name: git clone mostdiscussed-crawler
+ remote_user: horus
+ git:
+ repo: git@git.iamfabulous.de:curious-crawler
+ dest: /home/horus/code/mostdiscussed.com-crawler
+ accept_hostkey: yes
+
+- name: get go dependencies to build
+ remote_user: horus
+ ansible.builtin.shell: go mod tidy
+ args:
+ chdir: /home/horus/code/mostdiscussed.com-crawler
+
+- name: compile mostdiscussed.com-crawler (make build)
+ remote_user: horus
+ ansible.builtin.shell: make build
+ args:
+ chdir: /home/horus/code/mostdiscussed.com-crawler
+
+- name: set cronjob for mostdiscussed.com-crawler
+ ansible.builtin.cron:
+ name: "crawlt top stories on HN"
+ minute: "*/30"
+ user: "horus"
+ job: "/home/horus/code/mostdiscussed.com-crawler/mostdiscussed-crawler -s -c /home/horus/code/mostdiscussed.com-crawler/config.json"
+
+- name: copy config.json
+ remote_user: horus
+ copy:
+ src: config.json
+ dest: /home/horus/code/mostdiscussed.com-crawler/config.json
diff --git a/roles/packages/defaults/main.yml b/roles/packages/defaults/main.yml
index ed43812..3338f2c 100644
--- a/roles/packages/defaults/main.yml
+++ b/roles/packages/defaults/main.yml
@@ -12,6 +12,8 @@ default_packages_present_all:
- rsync
- screen
- whois
+ - make
+ - golang
# - imagemagick
# - imagemagick-6.q16
diff --git a/roles/ssh/files/config b/roles/ssh/files/config
new file mode 100644
index 0000000..d5a177e
--- /dev/null
+++ b/roles/ssh/files/config
@@ -0,0 +1,4 @@
+Host git.iamfabulous.de
+ Port 22
+ User git
+ IdentityFile ~/.ssh/git
diff --git a/roles/ssh/files/git b/roles/ssh/files/git
new file mode 100644
index 0000000..44aef12
--- /dev/null
+++ b/roles/ssh/files/git
@@ -0,0 +1,167 @@
+$ANSIBLE_VAULT;1.1;AES256
+30616430623138393166346638303839316566356638306465356562633235633133623762643739
+3830623965343933336133373633313635663563623865390a303936383463366333666461376536
+36633539663061353335363864656661633734363264663364363763633932396539366362613465
+6432633632623963630a653338663966353031656439633039313264646330613962633132396664
+62313136363661323965666137323038386331353462623833333034333938623462313566353139
+39656561616564363934653739356533363765316531643035366535626564313064643137613334
+64356133633933316366303537333462626631626565356237306337393561613765313761376332
+64663433353466353962396165333866393735373763353564323533353437393938356461316665
+31323135353462656465363832633834366235356262613362386138316262316537303038386639
+62656331396663363032343365363131363463333662363365623130363432646332306632316166
+39376531616435626233333632613561343832643231393366396161336631663066313233343035
+39316134646662343239663962356336636366313363326237306338393534353139376566643564
+34643030386633323338313662343231663133646537663931663264333662346364396536643166
+66656230316565316365663364376639316330356435343037393833613838663231623466366663
+30316332396430303734653164336639613939303337373637326163323435303231313833303233
+33316466363033616235313532623935653739653531393564623830636136313331626165636262
+37633631383464343565636233326262313036343831323064386331633763393362656133613536
+64636562306535363338623266326663643232643761396537373737306633383231653335666337
+65613630663265633061616630663537616664323563633533353661376332353037363364623633
+30613166383962386165346237623463643461346361363436363032396239333936323333363866
+31346134643330303239376366663565616232306461323763316336613732383130393730393961
+35343061376330653037336165356462356263376636356432363630383437336161326639313164
+31633466663730373864626231343136386333396361333661313664353164613635666335663837
+34313661326132316439353437396566336164313632353362323537333235666465343736636565
+66656232363762373438633638633736303866343939343963366539653536623166316434393661
+38616266336462613734353131613534323062373266363032616632613832316234306138343662
+65663737316431376365323634326464393835326331323062376232613564626433636563653563
+32323162313438313966383162666334623938666261626639386636643661623665653439663964
+30383332323665666130343562646638653061386131343835613662613033396665373133356565
+36323164316439303566346235646163313133376466643037663432316534633532313533353739
+32373832623633383531616565613664306464613466346630333664663765386531363165316364
+65613630633730623965393263366136393535366432343535353739663030303932393562623534
+31303062353136353336303332663833356638366335653035313436323566363066663331343034
+66613230643432356265633034616630623936613634373263343931376666633132653135306339
+31363835326637396561336262326334343536623861663564333138623534353061373333613339
+39643430656630393131396536646438356461333434346633633839643633336339343465313962
+61343833633131643330636339363565363264313939616365666539656162623231626636656464
+39646665396363323730653666343535633262616631383762643962323333336534356233393837
+30376638336163366233306364383037376363333632386630363630656564326364373363623563
+36643263306661356364343833356535653764656661326333373837333532643465383361613031
+31356464663633396664643030626332643232656633303235303666636463616233333939363732
+62363336633837343035346138366434306134333333653638336430613631306331613464623436
+39363161353635623035333634303332373531346265326164663663326536646535336130643334
+65663831613537366331626130356238663466666338383435383861336561383466363261613538
+61666238643266363537383334343339346165336236643864643933633962383639623461656364
+65613465313530373733626463363539343235363765623932383931323433636235633865383638
+36353538326533373663646261316362653066313063663166313439326137303739353338616262
+64396437343738313838323630643761666239323630663932336434303837626235383931636132
+32646530633236373033303765326165633061623565663634353165303235363637313365396639
+64353738663064636234336365343130396463346534333837643165303330356333613766306236
+39613939333166376664343566373837613435663966393039663435383439316661666431623535
+35643632666135616537633932366439396362623362353939303732386361343964326637633062
+63616662636436626338386265333565333863656365643632393433323562336162623661656432
+62313833653132613363323130316633623963356232623032323964323866616535333565643639
+30313837376239323934386235666166633965386265343934656466313736333134643664333165
+36623937636163323566646538346535653532323634633530303166366661663534656236323735
+62353661393337303966643736613735613138636666633862663263643237313632363035656364
+62643266363235613636336465653134663366376461376665323239303638336234656331353666
+31323463336636373239633138376137663432336430646436653535313035323038386630393965
+65646237636330646362653662333462666539313231623333646165333466623030306138643330
+38346164633232303533626433363961383862393637343434613063383138613964316466396263
+63653839343430316637333361306639633862376138313234363334386365306462363961653063
+38646136396633623834363066343165663836313231613565303433623931313033316637366464
+62326235346665613131633363643330323064396265326333393238396339306335643163383335
+36623232363731396161303161313765663630643262666336346338613066376133663534336330
+32353638623065396238643065396631323334346431316238663538393439343663356531323364
+39623533313064336261636539326237306239303032333832386530636166323436663433346630
+32616431366639333637313261643935353035616235373430323537306530326433353733663731
+33653739643334383535333864393564373363356163323031653861613961323031326265343333
+34666563663030333930366663663462636632643030306662393831353062303937303361366333
+38663933663533616634386463333536643263643932616637346263313563613732363238633363
+62396161626665653464613566363438656330623031666437666238626364316261663662393961
+32323735306137316535313165643139626532363237656563643134303236646332306230363537
+31626533313834623235313230623366646365306136643763363231363930656230383631393531
+62393933376633373634313463316230343463323165653836623261303136633963323961633263
+61613331626435646562393430316232653036313736356136353663393233643437386433393237
+33396134303838366561616132343532383431336532613866386639353830663438646239653764
+36636535663263376631376233623630373034666263616265356164333435306265366435663634
+61336465653433663366653138656462623233383364313138346462393032373163373063323362
+34373133626561626162666139353566313230316433363862383034613038663465353938396363
+36353635386162333131623131643731396638646563316630343466353266613630393063353966
+66623430633130353061613037623931363836363432366138613935356131653831323133386336
+63333961313733316130376134313936303863316634666133383631653266653365613839633062
+30343838346331663535643230323565353336313237346337643831653432363232306130313564
+62393831313732626331623765656233656333633431643164343162646631613861396330643131
+30623434303738373765316433623462386335323236376638666438363233363561656131363234
+31376638383963616330303730613665393836613831633766363334336430386266663337376535
+65383061616238613064663964306334323238663639366236303232636532313333346330373365
+36333464376337303135616132643361663138653636633334396364353464666564333165383565
+30333266636131393765373338356664613036396564343030303634643735393766613839636465
+64383465643665633832323962656534346238653736323133316535633436613431616164656334
+62636263393465643738313032623532623038313033646263316437326238363134336166313663
+32393532646232343530633336626132303139396135623137643761386530643234386635616165
+31376464636632613330393033363762363765643333646236636234646634626662353637366334
+63626163626633653839613337316265396436636263356464326531393235316232663865643438
+61383535383135383239313865363635623636316531636431383435646666386564653133343861
+36313939656663343736386335396331353463383666636433376365383036353262323562663365
+38623262306661363131356264653263393662613032613233326638313162616466613164343536
+38323536303431663232653333623538363434363539623130386164313537653563663433663132
+31613632653131353765363363623965303263386138373064363539313836313761303430643261
+66393136303032313439366531626131653333353634396131303634343831643031653036633534
+32303039326461313164323761356366323561643462663930643032613130333834376438663732
+30656530343132613239313131396266363230303837393765326432346439353739306238363730
+38656564353630633131623137353431303230643339656566303436303034636164313461626261
+37333663306662656562386231376263346635393335633431353962396431376132373763336261
+33653134613130326561333739653933336265323337393032306261663739636531636332643434
+38623932626238353133353038396662316661326262653565343230306331333437663166346164
+34386463386231613635333162613630356535653664346166306233393739623233313839626363
+32326234376264363263646232343562386463333161326133633930666262383132646133343538
+30343462323764633865323734383564343035393036393966656362623532303662383938333331
+31343133396330653765653832366637653337353032383965633239623139633237323231366162
+61346662663935663533353361343537643236653330633863646636653538396430343932363137
+62316165643735323034383861656161363231386431663532616333356264646236313234376363
+32383632356233373439363263373530306262313963666536306635376233623732363433363737
+61313439613766643034373134646535363736353866353563366339366466353636303363336535
+30613439396235333638363561323937323436623464646536396665363831313034353831643461
+34393034313734366436333436333938613766356534343535643362386166346339393166616235
+38386334386562306132643431356561303538333132386131613736343132386263353563376330
+64313432613539366361663832663339366133353032343630356435333730303037633334383562
+38366537646562633439396165623565393761316562626336393534363536343632663230303233
+36656637393438373937623839316530366538333133383034353836653964646433613439343563
+35323462323335326362383639356465326632666639343037323162356139336334326562356632
+30646332623564386633353636323636386237616564393363626339393662313033663563636439
+64303730303065333164636537363266396636303963633432653636386533353137356230666465
+66623535303461323965303338623231343938336461356465613339373834616332643733316365
+63373463326535346636363835313463616632616261393434343532313964363861663263643766
+38663431666634353836303534666462373362636165633335623466626365316535393933373331
+66666135336434636566383538643462656336363338356433616136616130346436386336396531
+66613661386539353464323433323634336637626238623831663334323664396630356161313864
+32356366623163393630383139646331306265363264393163303063333133633433303861323464
+36353463376432366465623463303261653733333461373664383331636536636639363232383936
+61636263383232396533393734636262653930626430636339326563316330356563616634626139
+31376262623937316632653961653432393136366362346664393137653935613438353437663164
+35323661376164643662333364303537306432313031373461653564343532613463353663366532
+39323134336537363930346330383761336466653933666238636534323165633761666163356137
+33303462643636653161373562623438623265393432343662373064376664626437323463653837
+66623139366365313631363332636166353162623831666261393866613338386163326233343062
+61383637663566326538303830366131396135613238613032386164643831636566646631363961
+36666139643639356261386161636166373764656530656262613739613534363536326535636234
+30303961633337333434616535396633346138356265363763343733346339393738306137383435
+35663232636566313937306336363362366435343537386537373561333434623065653230343961
+30383131393434613434393563393133323537626631346234393139333934663930333435613839
+66373537383536613133363863623633386537353764376463343265373161303562313332643734
+34366631363166373936633830363236353937623561356633343137343161623666643438366331
+63663135333533633631303632643765633630363235373562326435363766616461646135336333
+62363535633234363863353739336561383363613833383734633266386638393833353238393265
+62663935333666613336613962653639626562343037383465376631356463306332363139366438
+64623937383236376331656565623135653833653132376137333034643664316365306434393235
+65626232383065633739323363646366653038643762373563363339343938323666396433666436
+35363863613266626435623165336361366339646330306462353731353635373333303862333739
+39336665653064303362346362303563313735653635323564393362343836633335326333396432
+38633365393737386533346637633436663761623033396433653238356235313731326666393631
+34666362623930326437643732326261373362303861666664383137656634653531323465646265
+35303933383030373231303833623232623065653232616136333933313037386561626338316139
+39373030626563633533313132613033356337313536353362383836356535363032383763326438
+65393130376331646337626134343536636337313362626630363962393631393136666235353638
+61626164623734336539313332336332343535633037373236353338303737396434613135343632
+35633462336536383931363138663636333238316664306339323130396233373437613237613737
+31623433363961323338366465336135643966326631316638376166633535666339396239663030
+35663431376461626630646134613539386532636239316438386337636330653531336261613534
+66336566353530323335666131306530313161303165326437653065613166346561383662376530
+32313735343832623461316362333962396535633263666530376433343064343361616231393332
+61613966363035663334636237316466643335363433383737333763616463323839633866363439
+35383437366435626334326636353337346435353639373637383564366131333565343364666337
+66623132613464383262326438363835646137613938353264363666366135396138326531366162
+3062623939316435333835353138656539656232656632316565
diff --git a/roles/ssh/tasks/main.yml b/roles/ssh/tasks/main.yml
new file mode 100644
index 0000000..4bd765a
--- /dev/null
+++ b/roles/ssh/tasks/main.yml
@@ -0,0 +1,32 @@
+- name: mkdir ~horus/.ssh
+ file:
+ path: /home/horus/.ssh
+ state: directory
+
+- name: mkdir ~root/.ssh
+ file:
+ path: /root/.ssh
+ state: directory
+
+- name: copy ssh config for horus
+ copy:
+ src: config
+ dest: /home/horus/.ssh/config
+
+- name: copy ssh config for root
+ copy:
+ src: config
+ dest: /root/.ssh/config
+
+- name: copy git private ssh key for root
+ copy:
+ src: git
+ dest: /root/.ssh/git
+ mode: 0400
+
+- name: copy git private ssh key for horus
+ copy:
+ src: git
+ dest: /home/horus/.ssh/git
+ mode: 0400
+ owner: horus
diff --git a/site.yml b/site.yml
index d0c9764..1296890 100644
--- a/site.yml
+++ b/site.yml
@@ -43,3 +43,23 @@
tags:
- common-linux
- common
+
+# ------------------------------------------------------------
+
+- name: ssh
+ hosts: all
+ roles:
+ - ssh
+ tags:
+ - ssh
+ - common
+
+# ------------------------------------------------------------
+
+- name: mostdiscussed
+ hosts: code
+ roles:
+ - mostdiscussed
+ tags:
+ - mostdiscussed
+ - applications