---
- name: Install required packages
  apt: name={{ item }} state=present
  with_items:
    - php5
    - php5-curl
    - php5-mysql
    - libmysqlclient-dev
    - apache2
    - libapache2-mod-php5
    - imagemagick
    - libmagickcore-dev
    - libmagickwand-dev
    - ghostscript
    - libxslt1-dev
    - libxml-twig-perl

- name: Install required gems
  bundler: gemfile=/srv/www/openaustralia/openaustralia-parser/Gemfile state=present

- name: Enable apache modules
  apache2_module: state=present name={{ item }}
  notify: reload apache
  with_items:
    - expires
    - rewrite

- name: Copy across the php config
  template: src=php.ini dest=/etc/php5/{{ item }}/
  notify: reload apache
  with_items:
    - apache2
    - cli

- name: Copy across the apache config
  template: src=openaustralia.org.au.dev.conf dest=/etc/apache2/sites-available/
  notify: reload apache

- name: Enable virtual host
  file: src="../sites-available/openaustralia.org.au.dev.conf" dest="/etc/apache2/sites-enabled/openaustralia.org.au.dev.conf" state=link
  notify: reload apache

- name: Disable default virtual host
  file: dest="/etc/apache2/sites-enabled/000-default.conf" state=absent
  notify: reload apache

---
- name: Install required packages
  apt: name={{ item }} state=present
  with_items:
    - php5
    - php5-curl
    - php5-mysql
    - libmysqlclient-dev
    - apache2
    - libapache2-mod-php5
    - imagemagick
    - libmagickcore-dev
    - libmagickwand-dev
    - ghostscript
    - libxslt1-dev
    - libxml-twig-perl
    - liberror-perl

- name: Install required gems
  bundler: gemfile=/srv/www/openaustralia/openaustralia-parser/Gemfile state=present

- name: Enable apache modules
  apache2_module: state=present name={{ item }}
  notify: reload apache
  with_items:
    - expires
    - rewrite

- name: Copy across the php config
  template: src=php.ini dest=/etc/php5/{{ item }}/
  notify: reload apache
  with_items:
    - apache2
    - cli

- name: Copy across the apache config
  template: src=openaustralia.org.au.dev.conf dest=/etc/apache2/sites-available/
  notify: reload apache

- name: Enable virtual host
  file: src="../sites-available/openaustralia.org.au.dev.conf" dest="/etc/apache2/sites-enabled/openaustralia.org.au.dev.conf" state=link
  notify: reload apache

- name: Disable default virtual host
  file: dest="/etc/apache2/sites-enabled/000-default.conf" state=absent
  notify: reload apache

Install liberror-perl so that parse-members.rb script works
Install liberror-perl so that parse-members.rb script works
