Commit aae4a04f by Maruyama

roles/ruby: バージョンなど別ファイルへ

parent 351647df
---
- name: is exists source archive
command: ls -l "{{ruby_src_archive}}"
ignore_errors: true
register: already_downloaded
- name: already installed
command: which ruby
ignore_errors: true
register: already_installed
- name: download and extract
unarchive:
src: https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.8.tar.gz
dest: /tmp/
src: "{{ruby_src_url}}"
dest: "{{src_dir}}"
copy: no
when: not already_downloaded
- name: configure
command: /tmp/ruby-2.1.8/configure --prefix=/usr/
command: ./configure --prefix=/usr/
args:
chdir: /tmp/ruby-2.1.8
chdir: "{{ruby_src_dir}}"
when: not already_downloaded or not already_installed
- name: make
command: /usr/bin/make
args:
chdir: /tmp/ruby-2.1.8
chdir: "{{ruby_src_dir}}"
when: not already_downloaded or not already_installed
- name: install
command: /usr/bin/make install
args:
chdir: /tmp/ruby-2.1.8
become: yes
when: not already_downloaded or not already_installed
---
ruby_version: 2.1.8
ruby_dir: "ruby-{{ruby_version}}"
src_dir: /usr/local/src
ruby_src_dir: "/usr/local/src/{{ruby_dir}}"
ruby_src_archive: "{{ruby_src_dir}}.tar.gz"
ruby_src_url: "https://cache.ruby-lang.org/pub/ruby/2.1/{{ruby_dir}}.tar.gz"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment