---
#
# Setup paste
#
- name: install needed packages
  package: name={{ item }} state=present
  with_items:
  - sticky-notes
  - php-cli
  - php-common
  - php-mbstring
  - php-mysql
  - php-geshi
  - php-pdo
  - httpd
  - httpd-tools
  - rsync
  tags:
  - packages

- name: Fedora branding
  copy: src=skins/fedora/ dest=/usr/share/sticky-notes/skins/fedora owner=root group=root mode=775
  tags:
  - config

- name: sticky-notes httpd config
  copy: src=sticky-notes.conf dest=/etc/httpd/conf.d/sticky-notes.conf owner=root group=root mode=644
  tags:
  - config
  notify: reload httpd

- name: sticky-notes php config
  template: src=config.php dest=/etc/sticky-notes/config.php owner=apache group=apache mode=600
  tags:
  - config
  notify: reload httpd

- name: php post limit config
  copy: src=sticky-notes.ini dest=/etc/php.d/sticky-notes.ini owner=root group=root mode=644
  notify: reload httpd

- name: Use da.gd instead of ur1.ca
  copy: src=class_urlshort.php dest=/usr/share/sticky-notes/classes/class_urlshort.php owner=root group=root mode=644
  notify: reload httpd

- name: Hotfix show.php
  copy: src=show.php dest=/usr/share/sticky-notes/show.php owner=root group=root mode=644
  notify: reload httpd

- name: set sebooleans so paste can talk to the db
  seboolean: name=httpd_can_network_connect_db state=true persistent=true

- name: startup apache
  service: name=httpd enabled=yes state=started
