summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--roles/common-linux/tasks/main.yml6
-rw-r--r--roles/ghrss/files/config.json24
-rw-r--r--roles/ghrss/tasks/main.yml46
-rw-r--r--site.yml28
4 files changed, 94 insertions, 10 deletions
diff --git a/roles/common-linux/tasks/main.yml b/roles/common-linux/tasks/main.yml
index 5813a63..a83b334 100644
--- a/roles/common-linux/tasks/main.yml
+++ b/roles/common-linux/tasks/main.yml
@@ -24,6 +24,12 @@
path: /home/horus/code
state: directory
+- name: enable console
+ systemd:
+ name: serial-getty@ttyS0
+ state: started
+ enabled: yes
+
#- import_tasks: cronjobs.yml
diff --git a/roles/ghrss/files/config.json b/roles/ghrss/files/config.json
new file mode 100644
index 0000000..82076b6
--- /dev/null
+++ b/roles/ghrss/files/config.json
@@ -0,0 +1,24 @@
+$ANSIBLE_VAULT;1.1;AES256
+30326431393939626332653662353865333931313664306466356334613436613839666265633337
+6133346362316132366331363630333061306431353263310a343366666161316337303733343061
+36653834396362303564393065336339336639396636343931363465363331313734653533356566
+6561643437636236360a333561633865326266643131366365666639656163313865643831346331
+65633435303334656163663533383732326131313664663066336131373230663236663331343966
+30313462323236373639613763306537353866336232306161663630663134663635353439663334
+65653832373432323938663165636636653836376137313333386466633239383430656134333033
+32393433643231626534316432656265343063386337396266663230343564336637373236303563
+36643436633264333063396333323432623761326464373332336265646434663237636166353531
+64643438303964303233656563366639353330313064333733353435666238366631656262333164
+63346564343932653063663932393732613138326664663238613534656632333834353932366133
+65626662616130653535653335623663383832653730626531353961343637323433313266343133
+38376338303561356136663834333731313264396465653036363433353538613038393762313363
+64623365366463353965643761376438663961663866333662353534646131323730363662663532
+39333933646664383435346464653730306633666631663135396165373832313331613065303961
+63303964656366633163623835386135656163383664303733643263633232353265353430326333
+34366138626239363438666232633831343737653435613532393632343138363963376430653164
+33613932353966633063313031653632623738663863313834383032643866363030323264366532
+35666631303662663038326333373238656332366562343265363539373834643332663131376264
+61353662633164316534303666323662353461306632313564333061396232323837623635383038
+64383163623430633233316362613932316138343738333934316133316263643962303434313234
+34653739373366663534373637626532376533656230653435643538653034343336323538666661
+316362313832303263646433396335306536
diff --git a/roles/ghrss/tasks/main.yml b/roles/ghrss/tasks/main.yml
new file mode 100644
index 0000000..04caaf8
--- /dev/null
+++ b/roles/ghrss/tasks/main.yml
@@ -0,0 +1,46 @@
+- name: git clone ghrss-crawler
+ remote_user: horus
+ git:
+ repo: git@git.iamfabulous.de:ghrss
+ dest: /home/horus/code/ghrss
+ accept_hostkey: yes
+
+#- name: go mod init
+# remote_user: horus
+# ansible.builtin.shell: go mod init ghrss
+# args:
+# chdir: /home/horus/code/ghrss
+
+- name: get go dependencies to build
+ remote_user: horus
+ ansible.builtin.shell: go mod tidy
+ args:
+ chdir: /home/horus/code/ghrss
+
+- name: compile ghrss-crawler (make build)
+ remote_user: horus
+ ansible.builtin.shell: make build
+ args:
+ chdir: /home/horus/code/ghrss
+
+- name: set cronjob for ghrss-crawler
+ ansible.builtin.cron:
+ name: "crawlt Github #1"
+ minute: "50"
+ hour: "12"
+ user: "horus"
+ job: "/home/horus/code/ghrss/ghrss --config=/home/horus/code/ghrss/ --ignore-robots-txt --delay 10"
+
+- name: set cronjob for ghrss-crawler
+ ansible.builtin.cron:
+ name: "crawlt Github #2"
+ minute: "50"
+ hour: "23"
+ user: "horus"
+ job: "/home/horus/code/ghrss/ghrss --config=/home/horus/code/ghrss/ --ignore-robots-txt --delay 10"
+
+- name: copy config.json
+ remote_user: horus
+ copy:
+ src: config.json
+ dest: /home/horus/code/ghrss/config.json
diff --git a/site.yml b/site.yml
index a91f73f..db518a4 100644
--- a/site.yml
+++ b/site.yml
@@ -26,6 +26,16 @@
# ------------------------------------------------------------
+- name: common-linux
+ hosts: all
+ roles:
+ - common-linux
+ tags:
+ - common-linux
+ - common
+
+# ------------------------------------------------------------
+
- name: set up zsh for root and horus
hosts: all
become: no
@@ -92,16 +102,6 @@
# ------------------------------------------------------------
-- name: common-linux
- hosts: all
- roles:
- - common-linux
- tags:
- - common-linux
- - common
-
-# ------------------------------------------------------------
-
- name: ssh
hosts: all
roles:
@@ -120,4 +120,12 @@
- mostdiscussed
- applications
+- name: ghrss
+ hosts: code
+ roles:
+ - ghrss
+ tags:
+ - ghrss
+ - applications
+
#the_user: "{{ ansible_user_id }}"