summaryrefslogtreecommitdiffstats
path: root/roles/notifs/backend/tasks/main.yml
blob: 59d5b8ad1700790844252ad685a4cdde6a6abb15 (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
---
# Configuration for the notifications consumer

- name: install needed packages
  yum: pkg={{ item }} state=present
  with_items:
  - python-fmn-consumer
  - python-psycopg2
  - libsemanage-python
  # Needed to produce nice long emails about koji builds
  - koji
  tags:
  - notifs
  - notifs/backend

- name: install backend and sse packages
  yum: pkg={{ item }} state=present
  with_items:
  - python-fmn
  - python-fmn-sse
  when: env == "staging"
  tags:
  - notifs
  - notifs/backend

- name: copy database configuration
  template: >
    src={{ item }} dest=/etc/fedmsg.d/{{ item }}
    owner=fedmsg group=fedmsg mode=0600
  with_items:
  - fmn.consumer.py
  notify:
  - restart fedmsg-hub
  tags:
  - notifs
  - notifs/backend

- name: Install fmn SSE configuration
  template: >
    src={{ item }} dest=/etc/fedmsg.d/{{ item }}
    owner=fedmsg group=fedmsg mode=0600
  with_items:
  - fmn.sse.py
  when: env == "staging"
  notify:
  - restart fedmsg-hub
  tags:
  - notifs
  - notifs/backend

- name: copy the alembic configuration for DBAs
  template: >
    src=alembic.ini dest=/usr/share/fmn.lib/alembic.ini
    owner=root group=sysadmin-dba mode=0660
  when: env != "staging"
  notify:
  - restart fedmsg-hub
  tags:
  - notifs
  - notifs/backend

- name: copy the alembic configuration for DBAs
  template: >
    src=alembic.ini dest=/usr/share/fmn/alembic.ini
    owner=root group=sysadmin-dba mode=0660
  when: env == "staging"
  notify:
  - restart fedmsg-hub
  tags:
  - notifs
  - notifs/backend

- name: copy over admin utility scripts
  synchronize: src=bin/ dest=/usr/local/bin/
  tags:
  - notifs
  - notifs/backend

- name: override the default syslog logrotate file
  copy: src=syslog-logrotate dest=/etc/logrotate.d/syslog
  tags:
  - notifs
  - notifs/backend

- name: start the workers and the backend
  service: name={{item}} enabled=yes state=running
  with_items:
  - fmn-backend@1
  - fmn-worker@1
  - fmn-worker@2
  - fmn-worker@3
  - fmn-worker@4
  tags:
  - notifs
  - notifs/backend