Set correct rbenv+ruby-build PATH everywhere needed

This commit is contained in:
staticsafe 2017-11-27 13:18:27 -05:00
parent f2a01638da
commit c13efa8bd4
3 changed files with 21 additions and 9 deletions

View File

@ -11,15 +11,19 @@
become: true
become_user: mastodon
- name: Install bundler
shell: cd /home/mastodon/live && /home/mastodon/.rbenv/shims/gem install bundler
shell: cd /home/mastodon/live && gem install bundler
args:
executable: /bin/bash
environment:
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
become: true
become_user: mastodon
- name: Use bundler to install the rest of the Ruby dependencies
shell: cd /home/mastodon/live && /home/mastodon/.rbenv/shims/bundle install --deployment --without development test
shell: cd /home/mastodon/live && bundle install --deployment --without development test
args:
executable: /bin/bash
environment:
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
become: true
become_user: mastodon
- name: Use yarn to install node.js dependencies

View File

@ -4,28 +4,31 @@
# cron job
- name: Generate PAPERCLIP_SECRET and register it
shell: cd /home/mastodon/live && /home/mastodon/.rbenv/shims/bundle exec rake secret
shell: cd /home/mastodon/live && bundle exec rake secret
register: PAPERCLIP_SECRET
environment:
RAILS_ENV: production
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
args:
executable: /bin/bash
become: true
become_user: mastodon
- name: Generate SECRET_KEY_BASE and register it
shell: cd /home/mastodon/live && /home/mastodon/.rbenv/shims/bundle exec rake secret
shell: cd /home/mastodon/live && bundle exec rake secret
register: SECRET_KEY_BASE
environment:
RAILS_ENV: production
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
args:
executable: /bin/bash
become: true
become_user: mastodon
- name: Generate OTP_SECRET and register it
shell: cd /home/mastodon/live && /home/mastodon/.rbenv/shims/bundle exec rake secret
shell: cd /home/mastodon/live && bundle exec rake secret
register: OTP_SECRET
environment:
RAILS_ENV: production
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
args:
executable: /bin/bash
become: true
@ -38,10 +41,11 @@
become: true
become_user: mastodon
- name: Generate VAPID keys and register it
shell: cd /home/mastodon/live && /home/mastodon/.rbenv/shims/bundle exec rake mastodon:webpush:generate_vapid_key
shell: cd /home/mastodon/live && bundle exec rake mastodon:webpush:generate_vapid_key
register: VAPID_KEYS
environment:
RAILS_ENV: production
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
args:
executable: /bin/bash
become: true
@ -53,18 +57,20 @@
become: true
become_user: mastodon
- name: Precompile Mastodon static assets
shell: cd /home/mastodon/live && /home/mastodon/.rbenv/shims/bundle exec rails assets:precompile
shell: cd /home/mastodon/live && bundle exec rails assets:precompile
environment:
RAILS_ENV: production
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
args:
executable: /bin/bash
become: true
become_user: mastodon
- name: Run Mastodon database setup
shell: cd /home/mastodon/live && /home/mastodon/.rbenv/shims/bundle exec rails db:setup
shell: cd /home/mastodon/live && bundle exec rails db:setup
environment:
RAILS_ENV: production
SAFETY_ASSURED: 1
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
args:
executable: /bin/bash
become: true

View File

@ -29,8 +29,10 @@
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
shell: rbenv install 2.4.2 || rbenv global 2.4.2
args:
executable: /bin/bash
environment:
PATH: '/home/mastodon/.rbenv/bin:/home/mastodon/.rbenv/shims:/home/mastodon/.rbenv/plugins/ruby-build/bin:{{ ansible_env.PATH }}'
become: true
become_user: mastodon