- name: install supybot package
  yum: pkg={{ item }} state=present
  with_items:
  - supybot-gribble
  - supybot-fedora
  - supybot-koji
  - supybot-notify
  - supybot-pinglists
  - supybot-fedmsg

- name: creating zodbot log dir
  file: path={{ item }} state=directory owner=daemon
  with_items:
  - /var/lib/zodbot
  - /var/lib/zodbot/conf
  - /var/lib/zodbot/data
  - /var/lib/zodbot/logs
  - /srv/web
  - /srv/web/meetbot
  - /srv/web/meetbot/teams
  when: env != "staging"

- name: creating usrabot log dir
  file: path={{ item }} state=directory owner=daemon
  with_items:
  - /var/lib/ursabot
  - /var/lib/ursabot/conf
  - /var/lib/ursabot/data
  - /var/lib/ursabot/logs
  - /srv/web
  - /srv/web/meetbot
  - /srv/web/meetbot/teams
  when: env == "staging"

- name: setup meetings_by_team script
  copy: src=meetings_by_team.sh dest=/usr/local/bin/meetings_by_team.sh mode=755

- name: teams cron job
  cron: name=meetings-by-team hour="23" minute="0" user=daemon job="/usr/local/bin/meetings_by_team.sh"

- name: setup meetbot.conf apache config
  copy: src=meetbot.conf dest=/etc/httpd/conf.d/meetbot.conf mode=644

- name: /srv/web/meetbot file contexts
  command: semanage fcontext -a -t httpd_sys_content_t "/srv/web/meetbot(/.*)?"
