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
:/root
This is the location where temporary files will be stored while Ruby is being installed.
ruby_install_bundler
:true
Set 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
version
anduser_install
. For example:ruby_install_gems: - name: bundler version: '< 2' user_install: false
You can combine both methods of specifying gems.
ruby_install_gems_user
:username
This 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
:false
By default, this role installs Ruby using your system's package manager (
apt
oryum
). To install a specific version (like the latest), set this totrue
and/or changeruby_download_url
andruby_version
.ruby_download_url
:http://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0.tar.gz
The link to download Ruby (used only if
ruby_install_from_source
istrue
).ruby_version
:3.0.0
This is the Ruby version that will be installed (used only if
ruby_install_from_source
istrue
).ruby_source_configure_command
:./configure --enable-shared
The
configure
command to be run (used only ifruby_install_from_source
istrue
).ruby_rubygems_package_name
:rubygems
This is the name of the
rubygems
package. Normally, the default works, but it will change torubygems-integration
automatically 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.