From 4e8c8fb25024c6799cc57b76ab18f9129228b7e1 Mon Sep 17 00:00:00 2001 From: JOHNMWASHUMA Date: Fri, 1 Mar 2024 16:42:03 +0300 Subject: [PATCH] [Refactor] Remove become user and set become false to configure build locally --- tasks/configure.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index 63bad8b..a562808 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -14,12 +14,10 @@ path: "{{ react_local_checkout_path }}" production: false delegate_to: localhost - become: true - become_user: "{{ react_local_user }}" + become: false - name: Build app locally - become_user: "{{ react_local_user }}" - become: true + become: false delegate_to: localhost environment: "{{ item.env | default(react_build_cmds_default_env) }}" command: "yarn {{ item.cmd | default(react_build_default_cmd) }} {{ item.args | default() }}" @@ -37,31 +35,27 @@ chdir: "{{ react_local_checkout_path }}" ignore_errors: true delegate_to: localhost - become: true - become_user: "{{ react_local_user }}" + become: false - name: remove node_modules manually file: path: "{{ react_local_checkout_path }}/node_modules" state: absent delegate_to: localhost - become: true - become_user: "{{ react_local_user }}" + become: false - name: Compress Build folder locally archive: path: "{{ react_local_checkout_path }}/" dest: "{{ react_local_checkout_path }}.tgz" delegate_to: localhost - become: true - become_user: "{{ react_local_user }}" + become: false - name: UnCompress Build folder to remote host unarchive: src: "{{ react_local_checkout_path }}.tgz" dest: "{{ react_checkout_path }}" - become: true - become_user: "{{ react_system_user }}" + become: false when: "not react_remote_js_build|bool" - name: configure build remotely