- hosts: webservers
  vars_files:
    - vars.yml
  tasks:
    - name: setup group
      action: group name=$group_name state=present
    - name: setup user
      action: user name=$user_name state=present group=$group_name
    - name: set up packages
      action: apt pkg=$item state=latest
      with_items:
        - git
        - nginx
        - redis-server
        - supervisor
        - python-virtualenv
        - python-dev
        - libxslt1-dev # required for lxml
    - name: ensure directories
      action: file state=directory path=$item owner=$user_name group=$group_name
      with_items:
        - $deploy_root
        - $docs_root
      notify: fix permissions and ownerships
    - name: nginx configuration
      action: template src=templates/nginx-site.j2 dest=/etc/nginx/sites-enabled/$app_name.conf
      notify: restart nginx
    - name: nginx running
      action: service name=nginx state=started
    - name: ensure no nginx default conf
      action: file path=/etc/nginx/sites-enabled/default state=absent
      notify: restart nginx
  handlers:
    - include: handlers.yml

- hosts: webservers
  vars_files:
    - vars.yml
  tasks:
    - name: setup group
      action: group name=$group_name state=present
    - name: setup user
      action: user name=$user_name state=present group=$group_name
    - name: set up packages
      action: apt pkg=$item state=latest
      with_items:
        - git
        - nginx
        - redis-server
        - supervisor
        - python-virtualenv
        - python-lxml
        - python-dev
        - libxslt1-dev # required for lxml
    - name: ensure directories
      action: file state=directory path=$item owner=$user_name group=$group_name
      with_items:
        - $deploy_root
        - $docs_root
      notify: fix permissions and ownerships
    - name: nginx configuration
      action: template src=templates/nginx-site.j2 dest=/etc/nginx/sites-enabled/$app_name.conf
      notify: restart nginx
    - name: nginx running
      action: service name=nginx state=started
    - name: ensure no nginx default conf
      action: file path=/etc/nginx/sites-enabled/default state=absent
      notify: restart nginx
  handlers:
    - include: handlers.yml

Install lxml as base installation to save time
Install lxml as base installation to save time
