forked from kalos/ansible-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ruby-install.yml
41 lines (34 loc) · 1.17 KB
/
ruby-install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Install ruby-install
#
#
---
- name: Create working directory
file:
path: /usr/src
state: directory
- name: Check ruby-install installed
stat: path=/usr/local/bin/ruby-install
register: stat_ruby_install
- name: Download ruby-install
get_url:
url: https://github.com/postmodern/ruby-install/archive/v{{ ruby_install_version }}.tar.gz
dest: /usr/src/ruby-install-{{ ruby_install_version }}.tar.gz
when: stat_ruby_install.stat.exists == False
register: ruby_install_downloaded
- name: Extract ruby-install
shell: tar -C /usr/src -xzvf /usr/src/ruby-install-{{ ruby_install_version }}.tar.gz
when: ruby_install_downloaded.changed
register: ruby_install_extracted
- name: Install ruby-install
shell: cd /usr/src/ruby-install-{{ ruby_install_version }}/ && make install
when: ruby_install_extracted.changed
register: ruby_install_installed
- name: Clean up ruby-install sources
shell: rm -rf /usr/src/ruby-install-*
when: ruby_install_downloaded.changed
- name: Download list of rubies
shell: ruby-install
when: ruby_install_installed.changed
- name: Install latest ruby (MRI)
shell: ruby-install ruby
when: ruby_install_installed.changed