---
# Configuration for the pdc-updater backend consumer

- name: remove the old pdc-updater repo
  file: dest=/etc/yum.repos.d/ralph-pdc-updater-epel-7.repo state=absent
  tags: pdc

- name: install needed packages
  package: name={{ item }} state=present
  with_items:
  - pdc-updater
  tags: pdc

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

- name: copy client tool configuration
  template: >
    src={{ item }} dest=/etc/pdc.d/{{item}}
    owner=fedmsg group=fedmsg mode=0600
  with_items:
  - fedora.json
  tags: pdc

- name: setup cron for a daily audit script
  copy: src=pdc-audit.cron dest=/etc/cron.d/pdc-audit.cron mode=0755
  tags:
  - pdc
  - cron
