summaryrefslogtreecommitdiffstats
path: root/roles/mirrormanager/crawler/tasks/main.yml
blob: 11d456aca7d3f8b84730ffaaf7c997c18efddfee (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
41
42
43
44
45
46
47
48
49
50
51
---
# Configuration for MirrorManager's crawler

- name: install needed packages
  yum: pkg={{ item }} state=present update_cache=yes
  with_items:
  - mirrormanager2-crawler
  - python-psycopg2
  - fedmsg
  - python-GeoIP
  - jq
  tags:
  - packages

- name: create /etc/mirrormanager
  file: path=/etc/mirrormanager state=directory

- name: install MM configuration file
  template: src={{ item.file }} dest={{ item.dest }}
              owner=mirrormanager group=mirrormanager mode=0600
  with_items:
  - { file: "{{ roles_path }}/mirrormanager/frontend2/templates/mirrormanager2.cfg",
      dest: /etc/mirrormanager/mirrormanager2.cfg }
  - { file: "{{ roles_path }}/mirrormanager/frontend2/templates/alembic.ini",
      dest: /etc/mirrormanager/alembic.ini }
  tags:
  - config

- name: install the cron job
  copy: src=crawler.cron dest=/etc/cron.d/mm2_crawler.cron
  tags:
  - config
  when: env != 'staging'

- name: install crawling helper scripts
  copy: src={{ item }} dest=/usr/local/bin/{{ item }} mode=0755
  with_items:
  - mm2_get-mirrors-to-crawl
  - run_crawler.sh
  - check_propagation.sh

# Directory used to store the result of the repomd.xml propagation test
- name: create /var/log/mirrormanager/propagation
  file: path=/var/log/mirrormanager/propagation state=directory
          owner=mirrormanager group=mirrormanager mode=0755

- name: propagation cronjob
  cron: name="propagation-check" minute="27" hour="*/2" user="mirrormanager"
        job="/usr/local/bin/check_propagation.sh"
        cron_file=propagation-check
  when: inventory_hostname.startswith('mm-crawler01.phx2')