Skip to content

Instantly share code, notes, and snippets.

@judofyr

judofyr/ruby.yml Secret

Created July 30, 2013 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save judofyr/a3598b3bb2e54ca9298b to your computer and use it in GitHub Desktop.
Save judofyr/a3598b3bb2e54ca9298b to your computer and use it in GitHub Desktop.
---
- name: chruby
action: get_url url=https://raw.github.com/postmodern/chruby/master/share/chruby/chruby.sh
dest=/etc/profile.d/chruby.sh
sudo: True
- name: ruby-build
action: git repo=git://github.com/sstephenson/ruby-build.git dest=${home}/.ruby-build
- name: rubies directory
action: file path=${home}/.rubies state=directory
- name: Ruby dependencies
action: apt pkg=$item state=installed
with_items:
- build-essential
- zlib1g-dev
- libyaml-dev
- libssl-dev
- libgdbm-dev
- libreadline-dev
- libncurses5-dev
- libffi-dev
sudo: True
- name: Ruby
action: shell executable=/bin/bash
source /etc/profile;
chruby ${ruby.version}
${home}/.ruby-build/bin/ruby-build ${ruby.version} ${home}/.rubies/${ruby.version}
- name: Bundler
action: shell executable=/bin/bash
source /etc/profile;
chruby ${ruby.version};
which bundle || gem install bundler --no-rdoc --no-ri
---
- hosts: all
user: ubuntu
vars_files:
- "vars/common.yml"
tasks:
- include: tasks/upstart.yml
- include: tasks/ruby.yml
- include: tasks/code.yml
- include: tasks/riemann.yml
- name: Redis
action: apt pkg=redis-server state=installed
sudo: True
handlers:
- name: restart riemann
action: command restart riemann
- hosts: frontpage_scraper
user: ubuntu
vars_files:
- "vars/common.yml"
vars:
sampler:
path: ${home}/frontpage_sampler
tasks:
- name: Frontpage sampler directory
action: file path=${sampler.path} state=directory
- name: Frontpage sampler
action: template src=templates/sampler/sample dest=${sampler.path}/sample mode=0755
- name: Frontpage crontab
action: cron state=present
name="frontpage sampler"
minute="*/5"
user=${user}
job=${sampler.path}/sample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment