---

- name: install bugbot utilities
  pacman: name=python-irc,python-beautifulsoup4,python-lxml state=present

- name: clone bugbot source
  git:
    repo: https://gitlab.archlinux.org/archlinux/bugbot.git
    dest: /srv/bugbot
    force: true
    verify_commit: true
    version: "{{ bugbot_version }}"

- name: install env file
  template: src=bugbot.j2 dest=/srv/bugbot/env owner=root group=root mode=0600

- name: install bugbot systemd service
  copy: src=bugbot.service dest=/etc/systemd/system/bugbot.service

- name: start and enable bugbot service
  systemd: name=bugbot.service enabled=yes state=started daemon_reload=yes
