Update "build_wazuh_plugin" to fix conditional and update npm task

This commit is contained in:
Jose M 2019-11-28 11:49:40 +01:00
parent 50cd3745bb
commit 7f70b4dfeb

View File

@ -26,13 +26,9 @@
name: nodejs name: nodejs
state: present state: present
- name: Run NPM under root account
command: npm config set user 0
register: allow_root_npm
changed_when: false
- name: Install yarn dependency to build the Wazuh Kibana Plugin - name: Install yarn dependency to build the Wazuh Kibana Plugin
command: npm install -g yarn@1.10.1 # Using shell due to errors when evaluating text between @ with command
shell: "npm install -g {{ 'yarn' }}{{ '@' }}{{ '1.10.1'}}" # noqa 305
register: install_yarn_result register: install_yarn_result
changed_when: install_yarn_result == 0 changed_when: install_yarn_result == 0
@ -56,7 +52,7 @@
- "yarn build" - "yarn build"
- "yarn build" # Executing multiple times to workaround errors returned by yarn build - "yarn build" # Executing multiple times to workaround errors returned by yarn build
register: yarn_execution_result register: yarn_execution_result
changed_when: yarn_execution_result == 0 changed_when: false
args: args:
chdir: "/tmp/app/" chdir: "/tmp/app/"