From 2adc886e5c0c72b8c6560050c4edd30ea9fdbb56 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 18 Dec 2023 23:17:41 +0100 Subject: add role for mostdiscussed.com --- roles/mostdiscussed/tasks/main.yml | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 roles/mostdiscussed/tasks/main.yml (limited to 'roles/mostdiscussed/tasks') 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 -- cgit v1.2.3