summaryrefslogtreecommitdiff
path: root/roles/mostdiscussed/tasks/main.yml
blob: 64109fa81ca41ea5dfb1587b3e5deb2e3442ddda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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