Skip to content

Instantly share code, notes, and snippets.

@davejlong
Last active August 29, 2015 14:16
Show Gist options
  • Save davejlong/d61ce76526c4691e2ff8 to your computer and use it in GitHub Desktop.
Save davejlong/d61ce76526c4691e2ff8 to your computer and use it in GitHub Desktop.
Install Ruby if not already installed
- name: Download Ruby source
get_url: url=https://.../ruby-{{ ruby_version }}.tar.gz dest=/tmp/ruby.tar.gz
tags: ruby_install
- name: Make tmp directory for Ruby source
file: path=/tmp/ruby state=directory
tags: ruby_install
... Run through the rest of the configuration ...
---
- name: Check current Ruby version
shell: ruby --version 2>/dev/null | awk '{ print $2 }'
register: installed_ruby_version
# {{ ruby_version }} comes from my group variables
- include_ruby.yml
when: installed_ruby_version.stdout.find(ruby_version) != 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment