2017-11-24 20:08:51 +00:00
|
|
|
---
|
|
|
|
# All tasks in this role should be done as the mastodon user
|
2017-11-26 21:40:16 +00:00
|
|
|
# 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
|
2017-11-24 20:35:44 +00:00
|
|
|
- name: Copy .bashrc that has correct PATH and initiation for rbenv
|
|
|
|
copy:
|
|
|
|
src: .bashrc
|
|
|
|
dest: /home/mastodon/.bashrc
|
|
|
|
owner: mastodon
|
|
|
|
group: mastodon
|
|
|
|
mode: 0644
|
2017-11-24 20:36:51 +00:00
|
|
|
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
|
2020-05-09 15:18:56 +00:00
|
|
|
shell: rbenv install 2.6.6 || rbenv global 2.6.6
|
2017-11-24 20:08:51 +00:00
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
2017-11-27 18:18:27 +00:00
|
|
|
environment:
|
|
|
|
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
|
2017-12-11 16:34:33 +00:00
|
|
|
RUBY_CONFIGURE_OPTS: '--with-jemalloc'
|
2017-11-24 20:08:51 +00:00
|
|
|
become: true
|
|
|
|
become_user: mastodon
|