Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip installing ruby, the app does it #979

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions bin/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
- src: geerlingguy.security
version: 1.5.0

- src: zzet.rbenv
version: 3.4.2

- src: jdauphant.nginx
version: v2.21.2

Expand Down
22 changes: 0 additions & 22 deletions inventory/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@ swapfile_size: false

#----------------------------------------------------------------------
# Rails variables
ruby_version: 3.1.4

rbenv_extra_depends:
- libjemalloc-dev

ruby_compile_options: "--with-jemalloc"

ruby_versions:
- version: 3.1.4
env:
RUBY_CONFIGURE_OPTS: "{{ ruby_compile_options }}"

env:
RAILS_ENV: "{{ rails_env }}"
PATH: "{{ gem_home }}/bin:{{ ansible_env.PATH }}"
Expand Down Expand Up @@ -422,16 +410,6 @@ nginx_configs:
# Set python interpeter to the symlink created by setup
ansible_python_interpreter: '/usr/bin/python'

# Fix for renamed branch in rbenv-install repo
rbenv_plugins:
- { name: "rbenv-vars", repo: "https://github.com/rbenv/rbenv-vars.git", version: "master" }
- { name: "ruby-build", repo: "https://github.com/rbenv/ruby-build.git", version: "master" }
- { name: "rbenv-default-gems", repo: "https://github.com/rbenv/rbenv-default-gems.git", version: "master" }
- { name: "rbenv-installer", repo: "https://github.com/rbenv/rbenv-installer.git", version: "main" }
- { name: "rbenv-update", repo: "https://github.com/rkh/rbenv-update.git", version: "master" }
- { name: "rbenv-whatis", repo: "https://github.com/rkh/rbenv-whatis.git", version: "master" }
- { name: "rbenv-use", repo: "https://github.com/rkh/rbenv-use.git", version: "master" }

template_notice: |
# Managed via ofn-install, any changes will be overwritten.
# Please notify @devs of any changes in [#devops](https://openfoodnetwork.slack.com/archives/CEBMTRCNS) (But do not share secrets in public channel!)
19 changes: 0 additions & 19 deletions playbooks/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@
- role: language # Setup locale.
tags: language

- role: zzet.rbenv # Install ruby. If missing run: ansible-galaxy install zzet.rbenv
rbenv:
env: user
version: v1.0.0
default_ruby: "{{ ruby_version }}"
rubies: "{{ ruby_versions }}"
rbenv_set_vars: false
rbenv_users:
- "{{ app_user }}"
tags: ruby

- role: app # Build the app directory structure and support files.
become: yes
become_user: "{{ app_user }}"
Expand Down Expand Up @@ -111,14 +100,6 @@
tags: newrelic

tasks:
- name: Fix Ruby # no-changed-when
command:
cmd: bash -lc "rbenv uninstall -f {{ ruby_version }} && rbenv install {{ ruby_version }} && touch ~/.rbenv/versions/{{ ruby_version }}/.reinstalled"
creates: "~/.rbenv/versions/{{ ruby_version }}/.reinstalled"
become: yes
become_user: "{{ app_user }}"
when: ansible_distribution_major_version >= '20'

- meta: flush_handlers # Ensure handlers run successfully before reporting success

- name: notify slack
Expand Down
6 changes: 0 additions & 6 deletions roles/app/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,3 @@
version={{ l10n_git_version }}
force=yes
tags: l10n

- name: clear default rbenv vars
file:
dest: "{{ app_user_home_path }}/.rbenv/vars"
state: absent
become: yes
1 change: 1 addition & 0 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

# build ruby and gems
- build-essential
- libjemalloc-dev

# manage code
- git-core
Expand Down