summaryrefslogtreecommitdiff
path: root/roles/mostdiscussed
diff options
context:
space:
mode:
Diffstat (limited to 'roles/mostdiscussed')
-rw-r--r--roles/mostdiscussed/config.json8
-rw-r--r--roles/mostdiscussed/files/config.json18
-rw-r--r--roles/mostdiscussed/tasks/main.yml40
3 files changed, 66 insertions, 0 deletions
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