ansible-role-zammad/tasks/ruby.yml

54 lines
1.4 KiB
YAML

- name: "ruby: rbenv einrichten"
lineinfile:
path: "{{ zammad_user_home }}/.bashrc"
line: eval "$(rbenv init -)"
- name: "ruby: rbenv plugin-verzeichnis erstellen"
file:
path: "{{ ruby_path }}/plugins"
state: directory
owner: "{{ zammad_user }}"
group: "{{ zammad_user }}"
- name: "ruby: ruby-build installieren"
git:
repo: "{{ ruby_build_repo }}"
dest: "{{ ruby_path }}/plugins/ruby-build"
- name: "ruby: Version prüfen"
stat:
path: "{{ ruby_path }}/versions/{{ ruby_version.stdout }}"
register: ruby_installed
changed_when: false
check_mode: false
- name: "ruby installieren"
command:
cmd: "rbenv install {{ ruby_version.stdout }}"
chdir: "{{ zammad_user_home }}"
become: true
become_user: "{{ zammad_user }}"
when: ruby_installed.stat.exists == False
- name: "ruby: Bundler installieren"
command:
cmd: rbenv exec gem install bundler
chdir: "{{ zammad_home }}"
become: true
become_user: "{{ zammad_user }}"
- name: "ruby | Kopiere Gemfile.local"
copy:
src: Gemfile.local
dest: "{{ zammad_home }}/Gemfile.local"
owner: "{{ zammad_user }}"
group: "{{ zammad_user }}"
- name: "ruby: Ruby-Abhängigkeiten installieren"
shell: "rbenv exec bundle install --without test development mysql"
args:
chdir: "{{ zammad_home }}"
become: true
become_user: "{{ zammad_user }}"
environment:
RAILS_ENV: production