agaric-coop/box/provisioning/roles/geerlingguy.ruby/tasks/install-from-source.yml

63 lines
1.3 KiB
YAML
Raw Normal View History

---
- name: Install packages required to build ruby (RedHat).
yum: "name={{ item }} state=present"
with_items:
- '@development'
- zlib-devel
- openssl-static
when: ansible_os_family == 'RedHat'
- name: Update apt cache (Debian).
apt: update_cache=yes cache_valid_time=86400
when: ansible_os_family == 'Debian'
- name: Install packages required to build ruby (Debian).
apt: "name={{ item }} state=present"
with_items:
- build-essential
- zlib1g-dev
- libssl-dev
- libyaml-dev
- libreadline6-dev
- zlib1g-dev
- libncurses5-dev
- libffi-dev
- libgdbm3
- libgdbm-dev
when: ansible_os_family == 'Debian'
- name: Download ruby.
get_url:
url: "{{ ruby_download_url }}"
dest: "{{ workspace }}/ruby-{{ ruby_version }}.tar.gz"
- name: Extract ruby.
unarchive:
src: "{{ workspace }}/ruby-{{ ruby_version }}.tar.gz"
dest: "{{ workspace }}/"
copy: no
- name: Build ruby.
command: >
{{ item }}
chdir={{ workspace }}/ruby-{{ ruby_version }}
creates=/usr/local/bin/ruby
with_items:
- ./configure --enable-shared
- make
- make install
- name: Add ruby symlinks.
file:
src: "/usr/local/bin/{{ item }}"
dest: "/usr/bin/{{ item }}"
state: link
force: yes
with_items:
- erb
- gem
- irb
- rake
- rdoc
- ruby