summaryrefslogtreecommitdiffstats
path: root/roles/koschei/backend/tasks/main.yml
blob: d586005f7b35fea71ee61f6b6154bb75c39992c3 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
- name: install packages
  package: name={{ item }} state=installed
  with_items:
  - koschei-admin
  - koschei-backend
  - koschei-backend-fedora
  - postgresql
  tags:
  - koschei
  - packages

- name: create systemd config directories
  file: >
    path="/etc/systemd/system/{{ item }}.service.d"
    state=directory
  with_items: "{{ koschei_backend_services }}"
  notify:
  - reload systemd
  tags:
  - koschei
  - config
  - service

- name: install systemd config files
  copy: >
    src=systemd-memory-limit.conf
    dest=/etc/systemd/system/{{ item }}.service.d/memory-limit.conf
  with_items:
  - koschei-build-resolver
  - koschei-repo-resolver
  notify:
  - reload systemd
  - restart koschei-build-resolver
  - restart koschei-repo-resolver
  tags:
  - koschei
  - config
  - service

- name: install config files
  template: >
    src="{{ item }}.j2"
    dest="/etc/koschei/{{ item }}"
    owner=koschei
    group=koschei
    mode=0400
  with_items:
  - config-admin.cfg
  - config-backend.cfg
  notify:
  - restart koschei backend services
  tags:
  - koschei
  - config

- name: install koschei fedmsg config
  copy: src=koschei.py dest=/etc/fedmsg.d/koschei.py
  notify:
  - restart koschei backend services
  tags:
  - koschei
  - config
  - fedmsgdconfig

- name: install koji client config file
  template: >
    src="koji.conf.j2"
    dest="/etc/koji.conf"
  tags:
  - koschei
  - config

- name: enable services to start on boot
  service: name={{ item }} state=started enabled=true
  with_items: "{{ koschei_backend_services }}"
  tags:
  - koschei
  - service

- name: Copy the cleanup cronjob
  template: src=cron-db-cleanup.j2 dest=/etc/cron.d/cron-db-cleanup
  tags:
  - koschei
  - config

- name: Copy refresh-group script
  copy: >
    src=koschei-refresh-group
    dest=/usr/local/bin/koschei-refresh-group
    mode=755
  tags:
  - koschei
  - config

- name: Copy the group refresh cronjob
  template: src=cron-refresh-groups.j2 dest=/etc/cron.d/cron-refresh-groups
  tags:
  - koschei
  - config

- name: access to postgres for scripts
  template: src=pgpass.j2 dest=/var/cache/koschei/.pgpass
            owner=koschei group=koschei mode=0600
  tags:
  - koschei
  - config