Skip to content

Instantly share code, notes, and snippets.

@xecutioner
Created July 28, 2017 09:18
Show Gist options
  • Save xecutioner/f5c8bbec46ecd7a42f5e5506d3632b7b to your computer and use it in GitHub Desktop.
Save xecutioner/f5c8bbec46ecd7a42f5e5506d3632b7b to your computer and use it in GitHub Desktop.
---
- hosts: builo-test-web
strategy: debug
remote_user: ubuntu
gather_facts: false
pre_tasks:
- name: install aptitude
raw: sudo apt-get -y install aptitude
- name: install python
raw: sudo apt-get -y install python-simplejson
vars:
ansible_ssh_private_key_file: /Users/admin/.ssh/jyaasa-key-pair.pem
# this roles is given by adding in another plugin
# https://github.com/rvm/rvm1-ansible
roles:
- { role: rvm_io.ruby,
tags: ruby,
become: yes,
rvm1_rubies: ['ruby-2.2.5','ruby-2.3.1'],
rvm1_install_flags: '--auto-dotfiles', # Remove --user-install from defaults
rvm1_install_path: /usr/local/rvm, # Set to system location
rvm1_user: root # Need root account to access system location
}
tasks:
- name: test-connection
ping:
remote_user: ubuntu
- name: update
apt: update_cache=yes upgrade=full
become: yes
become_method: sudo
- name: install necessary stuffs
apt: name={{item}} state=installed
become: yes
become_method: sudo
with_items:
- curl
- wget
- git
- build-essential
- libcurl4-openssl-dev
- libpq-dev
- libpq5
- imagemagick
- libmagickwand-dev
- nodejs
- name: install passenger gem
command: gem install passenger
become: yes
become_method: sudo
- name : install nginx
become: yes
become_method: sudo
command: /bin/bash -l -c "swapoff /swapfile; rm /swapfile; dd if=/dev/zero of=/swapfile bs=1024 count=1024k; mkswap /swapfile; swapon /swapfile; passenger-install-nginx-module --auto --prefix=/opt/nginx --auto-download --languages ruby; swapoff /swapfile; rm /swapfile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment