---
# Configuration for the summershum consumer

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

- name: ensure summershum has a place to unpack files
  file: >
    dest=/var/cache/summershum
    state=directory
    mode=0755
    owner=fedmsg
    group=fedmsg

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

# TODO -- this can be removed soon.
# 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
