From 80d6d0f20292732814063e4eb9ee7cb9a214d9a4 Mon Sep 17 00:00:00 2001 From: Andrii Date: Wed, 11 Dec 2024 10:47:25 +0200 Subject: [PATCH] improve code --- ansible1/roles/packages/tasks/main.yml | 54 ++++++++++++-------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/ansible1/roles/packages/tasks/main.yml b/ansible1/roles/packages/tasks/main.yml index c2b99a315..5f3b6b8e8 100644 --- a/ansible1/roles/packages/tasks/main.yml +++ b/ansible1/roles/packages/tasks/main.yml @@ -59,34 +59,30 @@ mode: 644 # Install Bundler and configured gems -# - name: Install Bundler -# gem: -# name: bundler -# state: present -# user_install: false -# when: ruby_install_bundler - -# - name: Install configured gems -# gem: -# name: "{{ item.name | default(item) }}" -# version: "{{ item.version | default(omit) }}" -# user_install: false -# state: present -# become: true -# become_user: "{{ ruby_install_gems_user }}" -# with_items: "{{ ruby_install_gems }}" +- name: Install Bundler + gem: + name: bundler + state: present + user_install: false + when: ruby_install_bundler -# - name: Install development gems -# gem: -# name: "{{ item.name }}" -# version: "{{ item.version | default(omit) }}" -# user_install: false -# with_items: -# - { name: "pry-rails" } -# - { name: "letter_opener" } -# - { name: "web-console", version: ">= 4.1.0" } -# when: ruby_install_gems_development +- name: Install configured gems + gem: + name: "{{ item.name | default(item) }}" + version: "{{ item.version | default(omit) }}" + user_install: false + state: present + become: true + become_user: "{{ ruby_install_gems_user }}" + with_items: "{{ ruby_install_gems }}" -- name: Install all nessessary dependencies via bundle - shell: | - sudo bundle install +- name: Install development gems + gem: + name: "{{ item.name }}" + version: "{{ item.version | default(omit) }}" + user_install: false + with_items: + - { name: "pry-rails" } + - { name: "letter_opener" } + - { name: "web-console", version: ">= 4.1.0" } + when: ruby_install_gems_development