-
-
Save darkleaf/8051276 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- | |
hosts: default | |
vars: | |
postgresql: | |
version: 9.1 | |
password: my_secret_password | |
tasks: | |
- | |
name: install packages | |
apt: pkg={{ item }} state=installed | |
sudo: true | |
with_items: | |
- curl | |
- vim | |
- git | |
- runit | |
- python-pycurl | |
- postgresql-{{postgresql.version}} | |
- libpq-dev | |
- python-psycopg2 | |
- | |
name: add repositories | |
sudo: true | |
apt_repository: repo='ppa:nginx/stable' update_cache=yes | |
- | |
name: install nginx | |
apt: pkg=nginx state=installed | |
sudo: true | |
- | |
name: install RVM and Ruby | |
shell: curl -sSL https://get.rvm.io | bash -s stable --ruby --autolibs=enabled | |
creates=~/.rvm/bin/ruby | |
- | |
name: update postgres client configuration | |
sudo: true | |
copy: src=files/pg_hba.conf dest=/etc/postgresql/{{postgresql.version}}/main/pg_hba.conf | |
notify: | |
- restart postgresql | |
- | |
meta: flush_handlers | |
- | |
name: update nginx vhost conf | |
sudo: true | |
template: src=templates/nginx.j2 dest=/etc/nginx/conf.d/battle.conf | |
notify: | |
- reload nginx | |
- | |
name: create postgres user (battle) | |
postgresql_user: | |
name=battle | |
password={{ postgresql.password }} | |
- | |
name: create battle dev db | |
postgresql_db: | |
name={{ database }} | |
- | |
name: setup kerl | |
sudo: true | |
shell: | |
curl -O https://raw.github.com/spawngrid/kerl/master/kerl | |
&& chmod +x kerl | |
&& cp kerl /usr/local/bin | |
creates=/usr/local/bin/kerl | |
- | |
name: setup erlang | |
shell: | |
kerl build R16B02 r16b02 | |
&& kerl install r16b02 ~/.kerl/erlangs/r16b02 | |
creates=~/.kerl/erlangs/r16b02 | |
- | |
name: activate erlang | |
lineinfile: | |
dest=~/.bash_profile | |
line=". ~/.kerl/erlangs/r16b02/activate" | |
state=present | |
backup=yes | |
insertafter=EOF | |
handlers: | |
- | |
name: restart postgresql | |
sudo: true | |
service: name=postgresql state=restarted | |
- | |
name: reload nginx | |
sudo: true | |
service: name=nginx state=reloaded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment