Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - hosts: "rails"
- gather_facts: False
- sudo: True
- tasks:
- - name: Install system packages for rails
- apt: name=${item} state=present
- with_items:
- - build-essential
- - libcurl4-openssl-dev
- - libssl-dev
- - libpq-dev
- - libxslt1-dev
- - libxml2-dev
- - ruby1.9.3
- - name: Install required gems
- gem: name=${item} state=present
- with_items:
- - passenger
- - rails
- - name: Build nginx w passenger (LOOONG, can go for coffee) #TODO: async?
- shell: passenger-install-nginx-module --auto --auto-download --prefix=/opt/nginx creates=/opt/nginx
- - name: Setup nginx service with passenger init
- copy: dest=/etc/init.d/nginx src=files/nginx_rails_init mode=0755
- - name: Setup nice access to logs
- file: path=/var/log/nginx src=/opt/nginx/logs state=link
- - name: Setup nice access to conf
- file: path=/etc/nginx src=/opt/nginx/conf state=link
- - name: Ensure nginx is up
- service: name=nginx state=started enabled=yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement