---
- name: add the deadsnakes ppa
  apt_repository: repo="ppa:fkrull/deadsnakes" state=present

- name: install app packages
  apt: pkg={{ item }} state=present
  with_items:
    - python-pip
    - libpq-dev
    - libev-dev
    - libevent-dev
    - libmemcached-dev
    - libjpeg8
    - libjpeg8-dev
    - libfreetype6
    - libfreetype6-dev
    - zlib1g
    - zlib1g-dev
    - libxml2-dev
    - libxslt1-dev
    - ghostscript
    - python{{ python_version }}
    - python{{ python_version }}-dev
    - postfix

- name: ensure postfix is running
  service: name=postfix state=started

---
- name: add the deadsnakes ppa
  apt_repository: repo="ppa:fkrull/deadsnakes" state=present

- name: install app packages
  apt: pkg={{ item }} state=present
  with_items:
    - python-pip
    - libpq-dev
    - libev-dev
    - libevent-dev
    - libmemcached-dev
    - libjpeg8
    - libjpeg8-dev
    - libfreetype6
    - libfreetype6-dev
    - zlib1g
    - zlib1g-dev
    - libxml2-dev
    - libxslt1-dev
    - ghostscript
    - python{{ python_version }}
    - python{{ python_version }}-dev
    - postfix

- name: ensure postfix is running
  service: name=postfix state=started

- name: create the project user
  user: name={{ project_name }}
        home=/home/{{ project_name }}
        shell=/bin/bash
        groups=www-data append=yes

- name: create the project root directory
  file: path=/var/www/{{ project_name }}/
        state=directory
        owner={{ project_name }}
        group={{ project_name }}
        mode=775

- name: create the log directory
  file: path=/var/www/{{ project_name }}/log/
        state=directory
        owner={{ project_name }}
        group=www-data
        mode=775

- name: create the services directory
  file: path=/var/www/{{ project_name }}/services/
        state=directory
        owner={{ project_name }}
        group=www-data
        mode=775

- name: create the ssh directory
  file: path=/home/{{ project_name }}/.ssh/
        state=directory
        owner={{ project_name }}
        group={{ project_name }}
        mode=700

Set up the project directory structure.
Set up the project directory structure.
