--- # 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: /home/mastodon/.rbenv/bin/rbenv install 2.4.2 || /home/mastodon/.rbenv/bin/rbenv global 2.4.2 args: executable: /bin/bash become: true become_user: mastodon