---
# tasklist for setting up CGit

- name: install the needed packages
  package: name={{item}} state=present
  with_items:
  - cgit
  - mod_ssl
  - highlight
# https://bugzilla.redhat.com/show_bug.cgi?id=1134103
#  - lua-md5
  tags: cgit

# See https://github.com/robyduck/cgit-custom
- name: Make sure cgit directory exists
  file: dest=/usr/share/cgit state=directory owner=root group=root mode=0755
  tags: cgit

- name: Make sure cgit images directory exists
  file: dest=/usr/share/cgit/images state=directory owner=root group=root mode=0755
  tags: cgit

- name: Copy cgit them into place.
  copy: src={{item}} dest=/usr/share/cgit/{{item}} owner=root group=root mode=0644
  with_items:
  - cgit.css
  - cgit.png
  - cgit-fedora.css
  - fedora-layout.css
  - fedora-style.css
  - images/favicon.ico
  - images/html-bg.png
  - images/t.png
  tags: cgit

- name: put cgitrc in place for people
  copy: src=cgitrc.people dest=/etc/cgitrc owner=root mode=0644
  when: inventory_hostname.startswith('people')
  tags: cgit

- name: put cgitrc in place for batcave
  copy: src=cgitrc.batcave dest=/etc/cgitrc owner=root mode=0644
  when: inventory_hostname.startswith('batcave')
  tags: cgit

- name: put cgitrc in place for infinote
  copy: src=cgitrc.infinote dest=/etc/cgitrc owner=root mode=0644
  when: inventory_hostname.startswith('infinote')
  tags: cgit

#- name: install the libravatar filter
#  copy: src=email-libravatar-korg.lua dest=/usr/libexec/cgit/filters/email-libravatar-korg.lua owner=root group=root mode=0755
#  tags: cgit
