Adding nodejs recommended node_options and plugin optimization
This commit is contained in:
parent
cf55550589
commit
163c89dbab
@ -48,3 +48,6 @@ nodejs:
|
|||||||
# Build from sources
|
# Build from sources
|
||||||
build_from_sources: false
|
build_from_sources: false
|
||||||
wazuh_plugin_branch: 3.11-7.6
|
wazuh_plugin_branch: 3.11-7.6
|
||||||
|
|
||||||
|
#Nodejs NODE_OPTIONS
|
||||||
|
node_options: --max-old-space-size=4096
|
||||||
@ -63,9 +63,7 @@
|
|||||||
chdir: "/tmp/app/build"
|
chdir: "/tmp/app/build"
|
||||||
|
|
||||||
- name: Install Wazuh Plugin (can take a while)
|
- name: Install Wazuh Plugin (can take a while)
|
||||||
shell: "/usr/share/kibana/bin/kibana-plugin install file:///tmp/app/build/{{ wazuhapp_package_name.stdout }}"
|
shell: 'NODE_OPTIONS="{{node_options}}" /usr/share/kibana/bin/kibana-plugin install file:///tmp/app/build/{{ wazuhapp_package_name.stdout }}'
|
||||||
environment:
|
|
||||||
NODE_OPTIONS: "--max-old-space-size=3072"
|
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
creates: /usr/share/kibana/plugins/wazuh/package.json
|
creates: /usr/share/kibana/plugins/wazuh/package.json
|
||||||
|
|||||||
@ -62,6 +62,12 @@
|
|||||||
- kibana_xpack_security
|
- kibana_xpack_security
|
||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
|
- name: Node configuration
|
||||||
|
replace:
|
||||||
|
path: /usr/share/kibana/bin/kibana
|
||||||
|
regexp: 'NODE_OPTIONS=\"--no-warnings --max-http-header-size=65536 \$\{NODE_OPTIONS\}\" NODE_ENV=production exec \"\$\{NODE}\" \"\$\{DIR\}/src/cli\" \$\{@\}'
|
||||||
|
replace: 'NODE_OPTIONS="--no-warnings {{node_options}} --max-http-header-size=65536 ${NODE_OPTIONS}" NODE_ENV=production exec "${NODE}" "${DIR}/src/cli" ${@}'
|
||||||
|
|
||||||
- name: Ensuring certificates folder owner
|
- name: Ensuring certificates folder owner
|
||||||
file:
|
file:
|
||||||
path: "{{ node_certs_destination }}/"
|
path: "{{ node_certs_destination }}/"
|
||||||
@ -119,9 +125,7 @@
|
|||||||
|
|
||||||
|
|
||||||
- name: Install Wazuh Plugin (can take a while)
|
- 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"
|
shell: 'NODE_OPTIONS="{{node_options}}" /usr/share/kibana/bin/kibana-plugin install {{ wazuh_app_url }}-{{ wazuh_version }}_{{ elastic_stack_version }}.zip'
|
||||||
environment:
|
|
||||||
NODE_OPTIONS: "--max-old-space-size=3072"
|
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
creates: /usr/share/kibana/plugins/wazuh/package.json
|
creates: /usr/share/kibana/plugins/wazuh/package.json
|
||||||
@ -135,6 +139,13 @@
|
|||||||
when:
|
when:
|
||||||
- not build_from_sources
|
- not build_from_sources
|
||||||
|
|
||||||
|
- name: Kibana optimization (can take a while)
|
||||||
|
shell: 'NODE_OPTIONS="{{node_options}}" /usr/share/kibana/bin/kibana --optimize --allow-root'
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
become: yes
|
||||||
|
become_user: kibana
|
||||||
|
|
||||||
- name: Wait for Elasticsearch port
|
- name: Wait for Elasticsearch port
|
||||||
wait_for: host={{ elasticsearch_network_host }} port={{ elasticsearch_http_port }}
|
wait_for: host={{ elasticsearch_network_host }} port={{ elasticsearch_http_port }}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user