---
# Configuration for the notifications consumer

- name: install needed packages
  yum: pkg={{ item }} state=present
  with_items:
  - python-fmn-consumer
  - python-psycopg2
  - libsemanage-python

- 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

- 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
  notify:
  - restart fedmsg-hub

# Here I'm "permanently" hotfixing the fedmsg-hub
# It needs to load the forward-compat sqlalchemy0.7 package from the get-go.
- name: copy over patched fedmsg-hub
  copy: >
    src=patched-fedmsg-hub dest=/usr/bin/fedmsg-hub
    owner=root group=root mode=0755
  tags:
  - patches
  - hotfix
  notify:
  - restart fedmsg-hub
