Permalink
Switch branches/tags
Nothing to show
Find file Copy path
172 lines (141 sloc) 4.44 KB
##
# Ansible playbook for setting up a LAMP development server on Ubuntu 12.04.
#
---
- hosts: all
user: root
vars_files:
- settings.yml
tasks:
##
# Apt package installation of required software.
#
- name: General | Install required packages.
action: apt pkg={{ item }} state=installed
tags: common
with_items:
- php5
- apache2
- mysql-server
- mysql-client
- php5-mysql
- php-apc
- php5-xmlrpc
- php-soap
- php5-gd
- sendmail
- unzip
- python-mysqldb
##
# Message of the day explaining server is under control of Ansible.
#
- name: General | Message of the day explaining server is under Ansible control.
action: copy src=files/etc-update-motd-d-95-ansible dest=/etc/update-motd.d/95-ansible mode=755
tags: common
##
# PHP Setup.
#
- name: PHP | Configuration file, php.ini
action: template src=templates/etc-php5-apache2-php-ini.j2 dest=/etc/php5/apache2/php.ini
tags: common
- name: APC | Cache configuration file, apc.ini
action: template src=templates/etc-php5-conf-d-apc-ini.j2 dest=/etc/php5/conf.d/apc.ini
tags: common
##
# MySQL database setup.
#
- name: MySQL | Configuration file, my.cnf
action: template src=templates/etc-mysql-my-cnf.j2 dest=/etc/mysql/my.cnf
tags: common
- include: ../common-tasks/mysql-secure.yml
##
# Apache2 setup.
#
- name: Apache | Enable some required modules
action: command a2enmod rewrite vhost_alias
tags: common
- name: Apache | Configuration file for our site
action: template src=templates/etc-apache2-sites-available-devserver.j2 dest=/etc/apache2/sites-available/devserver
tags: common
- name: Apache | Disable the default site
action: command a2dissite default
tags: common
- name: Apache | Enable our new site
action: command a2ensite devserver
tags: common
##
# FTP server setup.
#
- name: FTP | vsftpd daemon package
action: apt pkg=vsftpd state=installed
tags: ftp
- name: FTP | Configuration setup
action: template src=templates/etc-vsftpd-conf.j2 dest=/etc/vsftpd.conf
tags: ftp
##
# Drush install, a Drupal shell tool.
#
- include: ../common-tasks/ubuntu-drush.yml
##
# node.js installation (latest stable instead of Ubuntu's out-of-date one)
#
- name: Node.js | Package prerequisites for node.js
action: apt pkg=python-software-properties state=installed
tags: nodejs
- name: Node.js | Add the node.js PPA
action: command add-apt-repository -y ppa:chris-lea/node.js creates=/etc/apt/sources.list.d/chris-lea-node_js-precise.list
tags: nodejs
- name: Node.js | Update the apt cache for the new repository
action: apt update-cache=yes
tags: nodejs
- name: Node.js | Install nodejs and npm
action: apt pkg={{ item }} state=installed
tags: nodejs
with_items:
- nodejs
- npm
##
# Redis server.
#
- name: Redis | Install redis
action: apt pkg=redis-server state=installed
tags: redis
##
# CSS compiling tools.
#
- name: CSS | Install rubygems package
action: apt pkg=rubygems state=installed
tags: css
- name: CSS | Install SASS
action: command gem install sass creates=/usr/local/bin/sass
tags: css
- name: CSS | Install Susy (no more --pre required as it is 1.0 now)
action: command gem install susy
tags: css
- name: CSS | Install Compass
action: command gem install compass creates=/usr/local/bin/compass
tags: css
- name: CSS | Install Aurora (which will install breakpoint, sass-buttons, respond-to)
action: command gem install compass-aurora
tags: css
##
# Dotcloud support
#
- name: Dotcloud | Python pip for dotcloud
action: apt pkg=python-pip state=installed
tags: dotcloud
- name: Dotcloud | Install dotcloud cli
action: command pip install dotcloud creates=/usr/local/bin/dotcloud
tags: dotcloud
##
# Restart services
#
- name: Restart Apache
action: service name=apache2 state=restarted
tags: common
- name: Restart MySQL
action: service name=mysql state=restarted
tags: common
- name: Restart vsftpd
action: service name=vsftpd state=restarted
tags: ftp