mass replacement has its culpits
This commit is contained in:
@@ -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[mastodon_user][4] }}/.rbenv"
|
dest: "{{ mastodon_user }}/.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[mastodon_user][4] }}/.rbenv/plugins/ruby-build"
|
dest: "{{ mastodon_user }}/.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[mastodon_user][4] }}/.rbenv/src"
|
chdir: "{{ mastodon_user }}/.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[mastodon_user][4] }}/.rbenv/src"
|
chdir: "{{ mastodon_user }}/.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[mastodon_user][4] }}/.profile"
|
dest: "{{ mastodon_user }}/.profile"
|
||||||
content: |
|
content: |
|
||||||
export PATH="{{ getent_passwd[mastodon_user][4] }}/.rbenv/bin:${PATH}"
|
export PATH="{{ mastodon_user }}/.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[mastodon_user][4] }}/.rbenv/bin/rbenv versions | grep -q {{ ruby_version }}"
|
shell: "{{ mastodon_user }}/.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[mastodon_user][4] }}/.rbenv/bin/rbenv install {{ ruby_version }}"
|
shell: "{{ mastodon_user }}/.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[mastodon_user][4] }}/.rbenv/bin/rbenv global {{ ruby_version }}"
|
shell: "{{ mastodon_user }}/.rbenv/bin/rbenv global {{ ruby_version }}"
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
register: default_ruby_version
|
register: default_ruby_version
|
||||||
|
|||||||
Reference in New Issue
Block a user