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

NodeJS node_options variable and Kibana plugin optimization #385

Merged
merged 13 commits into from
Mar 13, 2020
3 changes: 3 additions & 0 deletions roles/elastic-stack/ansible-kibana/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ nodejs:
# Build from sources
build_from_sources: false
wazuh_plugin_branch: 3.11-7.6

#Nodejs NODE_OPTIONS
node_options: --max-old-space-size=4096
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@
chdir: "/tmp/app/build"

- name: Install Wazuh Plugin (can take a while)
shell: "/usr/share/kibana/bin/kibana-plugin install file:///tmp/app/build/{{ wazuhapp_package_name.stdout }}"
environment:
NODE_OPTIONS: "--max-old-space-size=3072"
shell: NODE_OPTIONS="{{ node_options }}" /usr/share/kibana/bin/kibana-plugin install file:///tmp/app/build/{{ wazuhapp_package_name.stdout }}
args:
executable: /bin/bash
creates: /usr/share/kibana/plugins/wazuh/package.json
Expand Down
17 changes: 13 additions & 4 deletions roles/elastic-stack/ansible-kibana/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,10 @@
- build_from_sources is defined
- build_from_sources


- name: Install Wazuh Plugin (can take a while)
shell: "/usr/share/kibana/bin/kibana-plugin install {{ wazuh_app_url }}-{{ wazuh_version }}_{{ elastic_stack_version }}.zip"
environment:
NODE_OPTIONS: "--max-old-space-size=3072"
shell: >-
NODE_OPTIONS="{{ node_options }}" /usr/share/kibana/bin/kibana-plugin install
{{ wazuh_app_url }}-{{ wazuh_version }}_{{ elastic_stack_version }}.zip
args:
executable: /bin/bash
creates: /usr/share/kibana/plugins/wazuh/package.json
Expand All @@ -135,6 +134,16 @@
when:
- not build_from_sources

- name: Kibana optimization (can take a while)
shell: NODE_OPTIONS="{{ node_options }}" /usr/share/kibana/bin/kibana --optimize
args:
executable: /bin/bash
become: yes
become_user: kibana
changed_when: false
tags:
- skip_ansible_lint

- name: Wait for Elasticsearch port
wait_for: host={{ elasticsearch_network_host }} port={{ elasticsearch_http_port }}

Expand Down