Files
ansible/roles/mastodon/tasks/rbenv.yml
2024-07-05 11:53:33 +02:00

40 lines
1.1 KiB
YAML

---
- name: Git rbenv
remote_user: mastodon
ansible.builtin.git:
repo: "https://github.com/rbenv/rbenv.git"
dest: "{{ mastodon_home }}/.rbenv"
single_branch: true
version: master
- name: Git ruby-build
remote_user: mastodon
ansible.builtin.git:
repo: https://github.com/rbenv/ruby-build.git
dest: "{{ mastodon_home }}/.rbenv/plugins/ruby-build"
single_branch: true
version: master
- name: Append env to mastodon bashrc
remote_user: mastodon
ansible.builtin.lineinfile:
path: "{{ mastodon_home }}/.bashrc"
line: "eval \"$({{ mastodon_home }}/.rbenv/bin/rbenv init - bash)\""
- name: Install ruby version
remote_user: mastodon
ansible.builtin.shell: "bash -lic 'rbenv install {{ mastodon_ruby_version }}'"
args:
executable: /bin/bash
creates: "~/.rbenv/versions/{{ mastodon_ruby_version }}/bin/ruby"
environment:
RUBY_CONFIGURE_OPTS: "--with-jemalloc"
- name: Install bundler for ruby
remote_user: mastodon
ansible.builtin.shell: "bash -lic 'rbenv global {{ mastodon_ruby_version }} && ruby --version && gem install bundler --no-document'"
changed_when: true
args:
executable: /bin/bash