PaloAltoNetworks / minemeld-ansible

Ansible playbook for installing MineMeld on Linux
Apache License 2.0
48 stars 48 forks source link

Task [minemeld : gulp build] in error on Ubuntu 16.04 LTS #31

Open robgas opened 6 years ago

robgas commented 6 years ago

Hi, I'm trying on a fresh Ubuntu 16.04 LTS with last updates and the task [minemeld : gulp build] goes in error with a long message error that starts with:

fatal: [127.0.0.1]: FAILED! => {"changed": true, "cmd": ["gulp", "build"], "delta": "0:00:20.836314", "end": "2018-01-17 15:24:47.545702", "msg": "non-zero return code", "rc": 1, "start": "2018-01-17 15:24:26.709388", "stderr": "", "stderr_lines": [], "stdout": "[15:24:28] Using gulpfile /opt/minemeld/www/webui/gulpfile.js\n[15:24:28] Starting 'scripts'...\n[15:24:28] Starting 'styles'...\n[15:24:29] Starting 'partials'...\n[15:24:29] 'partials' errored after 125 ms\n[15:24:29] Error: Cannot find module 'lodash._reinterpolate'\n at Function.Module._resolveFilename...

I'm trying with minemeld_version: develop and with minemeld_version: master but I get the same error.

robgas commented 6 years ago

Hi, I have fixed the issue adding the following code in /roles/minemeld/tasks/webui.yml before the task gulp build:

- name: npm install lodash
  command: npm i --save lodash._reinterpolate chdir="{{webui_repo_directory}}"
  environment:
    NODE_VIRTUAL_ENV: "{{www_venv_directory}}"
    PATH: "{{www_venv_directory}}/lib/node_modules/.bin:{{www_venv_directory}}/bin:{{webui_repo_directory}}/node_modules/.bin:{{ ansible_env.PATH }}"
    NODE_PATH: "{{www_venv_directory}}/lib/node_modules"
    NPM_CONFIG_PREFIX: "{{www_venv_directory}}"
    npm_config_prefix: "{{www_venv_directory}}"
da667 commented 6 years ago

I too confirm this issue with both the development and stable releases for minemeld on Ubuntu 16.04.3. I have also confirmed that the changes that @robgas recommends to webui.yml above effectively resolve this problem, at least for the "master" branch.

rudiksh commented 6 years ago

---I have an issue with missing /vendor and binding ---resulting gulp error while running playbook if above solution don't work - npm rebuild node-sass - will fix the issue related gulp - "vendor directory missing"