mastible/roles/ruby/tasks/main.yml

40 lines
1.2 KiB
YAML

---
# 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
- 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
- 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
shell: rbenv install 2.5.0 || rbenv global 2.5.0
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'
become: true
become_user: mastodon