replaced ~ with more reliable data

This commit is contained in:
rene
2022-03-24 17:57:11 +01:00
parent 267995057b
commit f9bd653391
2 changed files with 16 additions and 16 deletions

View File

@@ -12,10 +12,10 @@
- name: Bundle install - name: Bundle install
shell: | shell: |
~/.rbenv/shims/bundle config set --local deployment 'true' && \ {{ mastodon_home }}/.rbenv/shims/bundle config set --local deployment 'true' && \
~/.rbenv/shims/bundle config set --local without 'test' && \ {{ mastodon_home }}/.rbenv/shims/bundle config set --local without 'test' && \
~/.rbenv/shims/bundle config set --local with 'development' && \ {{ mastodon_home }}/.rbenv/shims/bundle config set --local with 'development' && \
~/.rbenv/shims/bundle install -j$(getconf _NPROCESSORS_ONLN) {{ mastodon_home }}/.rbenv/shims/bundle install -j$(getconf _NPROCESSORS_ONLN)
args: args:
chdir: "{{ mastodon_home }}/{{ mastodon_path }}" chdir: "{{ mastodon_home }}/{{ mastodon_path }}"
@@ -35,13 +35,13 @@
register: production_config register: production_config
- name: Migrate database - name: Migrate database
shell: "RAILS_ENV=production ~/.rbenv/shims/bundle exec rails db:migrate" shell: "RAILS_ENV=production {{ mastodon_home }}/.rbenv/shims/bundle exec rails db:migrate"
args: args:
chdir: "{{ mastodon_home }}/{{ mastodon_path }}" chdir: "{{ mastodon_home }}/{{ mastodon_path }}"
when: production_config.stat.exists when: production_config.stat.exists
- name: Precompile assets - name: Precompile assets
shell: "RAILS_ENV=production ~/.rbenv/shims/bundle exec rails assets:precompile" shell: "RAILS_ENV=production {{ mastodon_home }}/.rbenv/shims/bundle exec rails assets:precompile"
args: args:
chdir: "{{ mastodon_home }}/{{ mastodon_path }}" chdir: "{{ mastodon_home }}/{{ mastodon_path }}"
when: production_config.stat.exists when: production_config.stat.exists

View File

@@ -3,14 +3,14 @@
- name: mastodon | Clone rbenv - name: mastodon | Clone rbenv
git: git:
repo: "https://github.com/rbenv/rbenv.git" repo: "https://github.com/rbenv/rbenv.git"
dest: "{{ getent_passwd[user][4] }}/.rbenv" dest: "{{ getent_passwd[mastodon_user][4] }}/.rbenv"
clone: true clone: true
version: "{{ rbenv_version }}" version: "{{ rbenv_version }}"
- name: mastodon | Clone ruby-build - name: mastodon | Clone ruby-build
git: git:
repo: "https://github.com/rbenv/ruby-build.git" repo: "https://github.com/rbenv/ruby-build.git"
dest: "{{ getent_passwd[user][4] }}/.rbenv/plugins/ruby-build" dest: "{{ getent_passwd[mastodon_user][4] }}/.rbenv/plugins/ruby-build"
clone: true clone: true
version: "{{ ruby_build_version }}" version: "{{ ruby_build_version }}"
register: ruby_build register: ruby_build
@@ -18,36 +18,36 @@
- name: mastodon | Configure rbenv - name: mastodon | Configure rbenv
command: ./configure command: ./configure
args: args:
chdir: "{{ getent_passwd[user][4] }}/.rbenv/src" chdir: "{{ getent_passwd[mastodon_user][4] }}/.rbenv/src"
register: rbenv_configure register: rbenv_configure
- name: mastodon | Build rbenv - name: mastodon | Build rbenv
command: make command: make
args: args:
chdir: "{{ getent_passwd[user][4] }}/.rbenv/src" chdir: "{{ getent_passwd[mastodon_user][4] }}/.rbenv/src"
when: rbenv_configure is succeeded when: rbenv_configure is succeeded
- name: mastodon | Update profile settings - name: mastodon | Update profile settings
blockinfile: blockinfile:
dest: "{{ getent_passwd[user][4] }}/.profile" dest: "{{ getent_passwd[mastodon_user][4] }}/.profile"
content: | content: |
export PATH="{{ getent_passwd[user][4] }}/.rbenv/bin:${PATH}" export PATH="{{ getent_passwd[mastodon_user][4] }}/.rbenv/bin:${PATH}"
eval "$(rbenv init -)" eval "$(rbenv init -)"
- name: mastodon | Check if the Ruby version is already installed - name: mastodon | Check if the Ruby version is already installed
shell: "{{ getent_passwd[user][4] }}/.rbenv/bin/rbenv versions | grep -q {{ ruby_version }}" shell: "{{ getent_passwd[mastodon_user][4] }}/.rbenv/bin/rbenv versions | grep -q {{ ruby_version }}"
register: ruby_installed register: ruby_installed
ignore_errors: yes ignore_errors: yes
check_mode: no check_mode: no
- name: mastodon | Install Ruby {{ ruby_version }} - name: mastodon | Install Ruby {{ ruby_version }}
shell: "{{ getent_passwd[user][4] }}/.rbenv/bin/rbenv install {{ ruby_version }}" shell: "{{ getent_passwd[mastodon_user][4] }}/.rbenv/bin/rbenv install {{ ruby_version }}"
args: args:
executable: /bin/bash executable: /bin/bash
when: ruby_installed is failed when: ruby_installed is failed
- name: mastodon | Set the default Ruby version to {{ ruby_version }} - name: mastodon | Set the default Ruby version to {{ ruby_version }}
shell: "{{ getent_passwd[user][4] }}/.rbenv/bin/rbenv global {{ ruby_version }}" shell: "{{ getent_passwd[mastodon_user][4] }}/.rbenv/bin/rbenv global {{ ruby_version }}"
args: args:
executable: /bin/bash executable: /bin/bash
register: default_ruby_version register: default_ruby_version
@@ -59,4 +59,4 @@
when: default_ruby_version is succeeded when: default_ruby_version is succeeded
become: true become: true
become_user: "{{ mastodon_user }}" become_mastodon_user: "{{ mastodon_user }}"