Permalink
Switch branches/tags
Nothing to show
Find file Copy path
2762f29 Aug 7, 2012
1 contributor

Users who have contributed to this file

72 lines (56 sloc) 2.23 KB
---
- hosts: webservers
user: ubuntu
sudo: True
tasks:
- name: add nginx ppa
action: apt_repository repo=ppa:nginx/stable state=present
- name: install common packages needed for python application development
action: apt pkg=$item state=installed
with_items:
- libpq-dev
- libmysqlclient-dev
- libxml2-dev
- libjpeg62
- libjpeg62-dev
- libfreetype6
- libfreetype6-dev
- zlib1g-dev
- mysql-client
- python-dev
- python-setuptools
- python-imaging
- python-mysqldb
- python-psycopg2
- git-core
- nginx
- name: install pip
action: easy_install name=pip
- name: install various libraries with pip
action: pip name=$item state=present
with_items:
- virtualenv
- supervisor
- uwsgi
- name: symlink imaging library files
action: file src=/usr/lib/x86_64-linux-gnu/libfreetype.so dest=/usr/lib/libfreetype.so state=link
- name: symlink imaging library files
action: file src=/usr/lib/x86_64-linux-gnu/libz.so dest=/usr/lib/libz.so state=link
- name: symlink imaging library files
action: file src=/usr/lib/x86_64-linux-gnu/libjpeg.so.62 dest=/usr/lib/x86_64-linux-gnu/libjpeg.so state=link
- name: symlink imaging library files
action: file src=/usr/lib/x86_64-linux-gnu/libjpeg.so dest=/usr/lib/libjpeg.so state=link
- name: remove default nginx site
action: file path=/etc/nginx/sites-enabled/default state=absent
- name: write nginx.conf
action: template src=templates/nginx.conf dest=/etc/nginx/nginx.conf
- name: create supervisord config folder
action: file dest=/etc/supervisor state=directory owner=root
- name: create supervisord config
action: template src=templates/supervisord.conf dest=/etc/supervisord.conf
- name: create supervisord init script
action: template src=templates/supervisord.sh dest=/etc/init.d/supervisord mode=0755
- name: start supervisord service and have it run during system startup
action: service name=supervisord state=started enabled=yes
- name: create webapps directory
action: file dest=/srv/webapps state=directory