mastible/roles/ruby/tasks/main.yml

40 lines
1.2 KiB
YAML
Raw Normal View History

2017-11-24 20:08:51 +00:00
---
# All tasks in this role should be done as the mastodon user
# This role installs rbenv, ruby-build and the right version of Ruby for
# Mastodon's use
2017-11-24 20:08:51 +00:00
- name: Clone rbenv git repository
git:
repo: 'https://github.com/rbenv/rbenv.git'
dest: /home/mastodon/.rbenv
become: true
become_user: mastodon
- name: Install rbenv
shell: cd ~/.rbenv && src/configure && make -C src
args:
executable: /bin/bash
become: true
become_user: mastodon
- name: Copy .bashrc that has correct PATH and initiation for rbenv
copy:
src: .bashrc
dest: /home/mastodon/.bashrc
owner: mastodon
group: mastodon
mode: 0644
backup: yes
2017-11-24 20:08:51 +00:00
- name: Install ruby-build as rbenv plugin
git:
repo: 'https://github.com/rbenv/ruby-build.git'
dest: /home/mastodon/.rbenv/plugins/ruby-build
become: true
become_user: mastodon
- name: Install Ruby and set it as the user's default
2018-11-03 22:12:59 +00:00
shell: rbenv install 2.5.3 || rbenv global 2.5.3
2017-11-24 20:08:51 +00:00
args:
executable: /bin/bash
environment:
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
RUBY_CONFIGURE_OPTS: '--with-jemalloc'
2017-11-24 20:08:51 +00:00
become: true
become_user: mastodon