lirlia.ruby
Ansible Role: Ruby
This role installs Ruby and the Bundler gem on Linux systems.
Requirements
No special requirements.
Role Variables
Here are the variables you can use, along with their default settings (see defaults/main.yml):
workspace:/rootThis is the location where temporary files will be stored while Ruby is being installed.
ruby_install_bundler:trueSet this to determine whether to install Bundler.
ruby_install_gems:[]List of Ruby gems you want to install (just the name of each gem). This offers a quick way to install the latest version of a gem. For more control, you can specify gem details elsewhere in your playbook.
You can also use a dictionary for each gem with specific options like
versionanduser_install. For example:ruby_install_gems: - name: bundler version: '< 2' user_install: falseYou can combine both methods of specifying gems.
ruby_install_gems_user:usernameThis is the user account under which the Ruby gems will be installed. If not specified, it defaults to the
ansible_ssh_user.ruby_install_from_source:falseBy default, this role installs Ruby using your system's package manager (
aptoryum). To install a specific version (like the latest), set this totrueand/or changeruby_download_urlandruby_version.ruby_download_url:http://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0.tar.gzThe link to download Ruby (used only if
ruby_install_from_sourceistrue).ruby_version:3.0.0This is the Ruby version that will be installed (used only if
ruby_install_from_sourceistrue).ruby_source_configure_command:./configure --enable-sharedThe
configurecommand to be run (used only ifruby_install_from_sourceistrue).ruby_rubygems_package_name:rubygemsThis is the name of the
rubygemspackage. Normally, the default works, but it will change torubygems-integrationautomatically on Ubuntu Trusty (14.04).
Dependencies
None.
Example Playbook
- hosts: server
roles:
- role: geerlingguy.ruby
License
MIT / BSD
Author Information
This role was created in 2014 by Jeff Geerling, the author of Ansible for DevOps.
