Skip to content

Ansible playbook with roles looping for multiple ruby versions installation using rbenv

Notifications You must be signed in to change notification settings

leucos/ansible-rbenv-playbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby/Rbenv with Ansible

NOTE: this stuff is deprecated

Take a look at erasme.rbenv instead.

This playbok demonstrates (ab)using roles to install several ruby versions via rbenv.

Pre-requisites

"Quick" start

vagrant up
ansible-playbook -i hosts ruby.yml
ansible all -i hosts -m command -a 'bash -lc "rbenv versions"' -u vagrant 

Vagrant

A Vagrantfile is provided for testing purposes. It will create two VMs, and provision them with ansible.

vagrant up

If you encounter this error :

fatal: [ruby1] => {'msg': "FAILED: (25, 'Inappropriate ioctl for device')", 'failed': True}

get a newer vagrant version (1.3.5+) or issue :

export ANSIBLE_HOST_KEY_CHECKING=false

before redoing a vagrant up.

The playbook

ansible-playbook -i hosts ruby.yml

will make your computer fans scream and cores smoke. Eventually, it will install MRI 2.1.0 and 2.0.0-p353 on both hosts with 2.0.0-p353 being the default Ruby on ruby0, and 2.1.0 on ruby1.

You can check what happened with :

ansible all -i hosts -m command -a 'bash -lc "rbenv versions"' -u vagrant

Thanks

Thanks to Ansible's Google Groups fellows for their help on this, and especially Jerome Wagner for the role prereq trick. Hack away, send PRs !

About

Ansible playbook with roles looping for multiple ruby versions installation using rbenv

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages