Skip to content

Instantly share code, notes, and snippets.

@inertialbit
Created January 21, 2013 18:10
Show Gist options
  • Save inertialbit/4588017 to your computer and use it in GitHub Desktop.
Save inertialbit/4588017 to your computer and use it in GitHub Desktop.
installs rbenv via rbenv-installer, ruby matching $ruby_version and passenger + apache2 module to $user home and updates $user/.bash_profile w/ rbenv env vars
---
- name: install rb-installer
action: shell curl https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
- name: update PATH in ~/.bash_profile for rb-env
action: lineinfile dest=/home/$user/.bash_profile line=export\ PATH="$HOME/.rbenv/bin:$PATH" regexp=PATH.*rbenv
- name: add rb-env init to ~/.bash_profile
action: lineinfile dest=/home/$user/.bash_profile line='eval "$(rbenv init -)"' regexp=eval.*rbenv
- name: install ruby
action: shell /home/$user/.rbenv/bin/rbenv install $ruby_version creates=/home/$user/.rbenv/shims/ruby
- name: make ruby global
action: shell /home/$user/.rbenv/bin/rbenv global $ruby_version
- name: bootstrap any missing packages
action: shell /home/$user/.rbenv/bin/rbenv bootstrap-ubuntu-12-04
- name: bootstrap rbenv
action: shell /home/$user/.rbenv/bin/rbenv bootstrap
- name: install passenger
action: shell PATH=/home/$user/.rbenv/bin:$PATH /home/$user/.rbenv/shims/gem install passenger creates=/home/$user/.rbenv/shims/passenger
- name: initialize rbenv
action: shell bash /home/$user/.bash_profile
- name: install passenger apache2 module
action: shell PATH=/home/$user/.rbenv/bin:$PATH /home/$user/.rbenv/shims/passenger-install-apache2-module --auto creates=/home/$user/.rbenv/versions/$ruby_version/lib/ruby/gems/1.9.1/gems/passenger-$passenger_version/ext/apache2/mod_passenger.so
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment