Skip to content

Instantly share code, notes, and snippets.

@trooney
Last active December 28, 2015 07:49
Show Gist options
  • Save trooney/7467382 to your computer and use it in GitHub Desktop.
Save trooney/7467382 to your computer and use it in GitHub Desktop.
Ansible | Dev Environment
---
- hosts: all
sudo: True
pre_tasks:
- name: APT | Check cache update time
stat: path=/var/cache/apt
register: apt_cache_stat
- name: APT | Update stale cache
apt: update_cache=yes
when: ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > 60*60*12
tasks:
- name: APT | Install PHP packages
apt: pkg={{ item }} state=installed
with_items:
- php5
- php5-cli
- php5-fpm
- php5-mysql
- php5-sybase
- php-apc
- name: PHP | Set timezone
lineinfile: state=present backup=yes create=yes dest={{ item }} regexp='^date\.timezone =' insertafter='^;date\.timezone =' line='date.timezone = Atlantic/Bermuda'
with_items:
- /etc/php5/cli/php.ini
- /etc/php5/apache2/php.ini
- /etc/php5/fpm/php.ini
- name: PHP | Install composer
shell:
curl -sS https://getcomposer.org/installer | /usr/bin/php && /bin/mv -f ~/composer.phar /usr/local/bin/composer chdir=~ creates=/usr/local/bin/composer
- name: APT | Install NodeJS PPA required packages
apt: pkg={{ item }} state=installed
with_items:
- python-software-properties
- python-apt
- python-pycurl
- name: APT | Install NodeJS PPA Repository
apt_repository: repo=ppa:chris-lea/node.js update_cache=yes
- name: APT | Install NodeJS
apt: pkg={{ item }} state=installed
with_items:
- nodejs
# - name: NPM | Install less
# npm: name=less global=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment