Merge pull request #245 from wazuh/242-elastic-multiline-fix
242 elastic multiline fix
This commit is contained in:
commit
4e4151e674
@ -60,9 +60,10 @@
|
|||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
- name: Generating certificates for Elasticsearch security (generating CA)
|
- name: Generating certificates for Elasticsearch security (generating CA)
|
||||||
shell: >-
|
command: >-
|
||||||
/usr/share/elasticsearch/bin/elasticsearch-certutil cert ca --pem --in
|
/usr/share/elasticsearch/bin/elasticsearch-certutil cert ca --pem
|
||||||
{{ node_certs_source }}/instances.yml --out {{ node_certs_source }}/certs.zip
|
--in {{ node_certs_source }}/instances.yml
|
||||||
|
--out {{ node_certs_source }}/certs.zip
|
||||||
when:
|
when:
|
||||||
- node_certs_generator
|
- node_certs_generator
|
||||||
- not xpack_certs_zip.stat.exists
|
- not xpack_certs_zip.stat.exists
|
||||||
@ -70,28 +71,31 @@
|
|||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
- name: Generating certificates for Elasticsearch security (using provided CA | Without CA Password)
|
- name: Generating certificates for Elasticsearch security (using provided CA | Without CA Password)
|
||||||
shell: >-
|
command: >-
|
||||||
/usr/share/elasticsearch/bin/elasticsearch-certutil cert
|
/usr/share/elasticsearch/bin/elasticsearch-certutil cert
|
||||||
--ca-key {{ node_certs_source }}/{{ ca_key_name }} --ca-cert {{ node_certs_source }}/{{ ca_cert_name }}
|
--ca-key {{ node_certs_source }}/{{ ca_key_name }}
|
||||||
--pem --in {{ node_certs_source }}/instances.yml --out {{ node_certs_source }}/certs.zip
|
--ca-cert {{ node_certs_source }}/{{ ca_cert_name }}
|
||||||
|
--pem --in {{ node_certs_source }}/instances.yml
|
||||||
|
--out {{ node_certs_source }}/certs.zip
|
||||||
when:
|
when:
|
||||||
- node_certs_generator
|
- node_certs_generator
|
||||||
- not xpack_certs_zip.stat.exists
|
- not xpack_certs_zip.stat.exists
|
||||||
- not generate_CA
|
- not generate_CA
|
||||||
- ca_password == ""
|
- ca_password | length == 0
|
||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
- name: Generating certificates for Elasticsearch security (using provided CA | Using CA Password)
|
- name: Generating certificates for Elasticsearch security (using provided CA | Using CA Password)
|
||||||
shell: >-
|
command: >-
|
||||||
/usr/share/elasticsearch/bin/elasticsearch-certutil cert
|
/usr/share/elasticsearch/bin/elasticsearch-certutil cert
|
||||||
--ca-key {{ node_certs_source }}/{{ ca_key_name }} --ca-cert {{ node_certs_source }}/{{ ca_cert_name }}
|
--ca-key {{ node_certs_source }}/{{ ca_key_name }}
|
||||||
|
--ca-cert {{ node_certs_source }}/{{ ca_cert_name }}
|
||||||
--pem --in {{ node_certs_source }}/instances.yml --out {{ node_certs_source }}/certs.zip
|
--pem --in {{ node_certs_source }}/instances.yml --out {{ node_certs_source }}/certs.zip
|
||||||
--ca-pass {{ca_password}}
|
--ca-pass {{ ca_password }}
|
||||||
when:
|
when:
|
||||||
- node_certs_generator
|
- node_certs_generator
|
||||||
- not xpack_certs_zip.stat.exists
|
- not xpack_certs_zip.stat.exists
|
||||||
- not generate_CA
|
- not generate_CA
|
||||||
- ca_password != ""
|
- ca_password | length > 0
|
||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
- name: Verify the Elastic certificates directory
|
- name: Verify the Elastic certificates directory
|
||||||
@ -131,8 +135,8 @@
|
|||||||
|
|
||||||
- name: Unzip generated certs.zip
|
- name: Unzip generated certs.zip
|
||||||
unarchive:
|
unarchive:
|
||||||
src: "{{master_certs_path}}/certs.zip"
|
src: "{{ master_certs_path }}/certs.zip"
|
||||||
dest: "{{master_certs_path}}/"
|
dest: "{{ master_certs_path }}/"
|
||||||
become: true
|
become: true
|
||||||
delegate_to: "127.0.0.1"
|
delegate_to: "127.0.0.1"
|
||||||
when:
|
when:
|
||||||
@ -141,24 +145,24 @@
|
|||||||
|
|
||||||
- name: Copying node's certificate from master
|
- name: Copying node's certificate from master
|
||||||
copy:
|
copy:
|
||||||
src: "{{item}}"
|
src: "{{ item }}"
|
||||||
dest: "{{node_certs_destination}}/"
|
dest: "{{ node_certs_destination }}/"
|
||||||
with_items:
|
with_items:
|
||||||
- "{{master_certs_path}}/{{elasticsearch_node_name}}/{{ elasticsearch_node_name }}.key"
|
- "{{ master_certs_path }}/{{ elasticsearch_node_name }}/{{ elasticsearch_node_name }}.key"
|
||||||
- "{{master_certs_path}}/{{elasticsearch_node_name}}/{{ elasticsearch_node_name }}.crt"
|
- "{{ master_certs_path }}/{{ elasticsearch_node_name }}/{{ elasticsearch_node_name }}.crt"
|
||||||
- "{{master_certs_path}}/ca/ca.crt"
|
- "{{ master_certs_path }}/ca/ca.crt"
|
||||||
when:
|
when:
|
||||||
- generate_CA
|
- generate_CA
|
||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
- name: Copying node's certificate from master (Custom CA)
|
- name: Copying node's certificate from master (Custom CA)
|
||||||
copy:
|
copy:
|
||||||
src: "{{item}}"
|
src: "{{ item }}"
|
||||||
dest: "{{node_certs_destination}}/"
|
dest: "{{ node_certs_destination }}/"
|
||||||
with_items:
|
with_items:
|
||||||
- "{{master_certs_path}}/{{elasticsearch_node_name}}/{{ elasticsearch_node_name }}.key"
|
- "{{ master_certs_path }}/{{ elasticsearch_node_name }}/{{ elasticsearch_node_name }}.key"
|
||||||
- "{{master_certs_path}}/{{elasticsearch_node_name}}/{{ elasticsearch_node_name }}.crt"
|
- "{{ master_certs_path }}/{{ elasticsearch_node_name }}/{{ elasticsearch_node_name }}.crt"
|
||||||
- "{{master_certs_path}}/ca/{{ca_cert_name}}"
|
- "{{ master_certs_path }}/ca/{{ ca_cert_name }}"
|
||||||
when:
|
when:
|
||||||
- not generate_CA
|
- not generate_CA
|
||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
@ -175,8 +179,8 @@
|
|||||||
tags: xpack-security
|
tags: xpack-security
|
||||||
|
|
||||||
- name: Set elasticsearch bootstrap password
|
- name: Set elasticsearch bootstrap password
|
||||||
shell: >-
|
command: >-
|
||||||
|
set -o pipefail
|
||||||
echo {{ elasticsearch_xpack_security_password }} | {{ node_certs_source }}/bin/elasticsearch-keystore add -xf bootstrap.password
|
echo {{ elasticsearch_xpack_security_password }} | {{ node_certs_source }}/bin/elasticsearch-keystore add -xf bootstrap.password
|
||||||
when:
|
when:
|
||||||
- node_certs_generator
|
- node_certs_generator
|
||||||
|
|
||||||
@ -28,12 +28,12 @@
|
|||||||
|
|
||||||
- name: Copying node's certificate from master
|
- name: Copying node's certificate from master
|
||||||
copy:
|
copy:
|
||||||
src: "{{item}}"
|
src: "{{ item }}"
|
||||||
dest: "{{node_certs_destination}}/"
|
dest: "{{ node_certs_destination }}/"
|
||||||
with_items:
|
with_items:
|
||||||
- "{{master_certs_path}}/{{filebeat_node_name}}/{{ filebeat_node_name }}.key"
|
- "{{ master_certs_path }}/{{ filebeat_node_name }}/{{ filebeat_node_name }}.key"
|
||||||
- "{{master_certs_path}}/{{filebeat_node_name}}/{{ filebeat_node_name }}.crt"
|
- "{{ master_certs_path }}/{{ filebeat_node_name }}/{{ filebeat_node_name }}.crt"
|
||||||
- "{{master_certs_path}}/ca/ca.crt"
|
- "{{ master_certs_path }}/ca/ca.crt"
|
||||||
when:
|
when:
|
||||||
- generate_CA
|
- generate_CA
|
||||||
- filebeat_xpack_security
|
- filebeat_xpack_security
|
||||||
@ -41,12 +41,12 @@
|
|||||||
|
|
||||||
- name: Copying node's certificate from master (Custom CA)
|
- name: Copying node's certificate from master (Custom CA)
|
||||||
copy:
|
copy:
|
||||||
src: "{{item}}"
|
src: "{{ item }}"
|
||||||
dest: "{{node_certs_destination}}/"
|
dest: "{{ node_certs_destination }}/"
|
||||||
with_items:
|
with_items:
|
||||||
- "{{master_certs_path}}/{{filebeat_node_name}}/{{ filebeat_node_name }}.key"
|
- "{{ master_certs_path }}/{{ filebeat_node_name }}/{{ filebeat_node_name }}.key"
|
||||||
- "{{master_certs_path}}/{{filebeat_node_name}}/{{ filebeat_node_name }}.crt"
|
- "{{ master_certs_path }}/{{ filebeat_node_name }}/{{ filebeat_node_name }}.crt"
|
||||||
- "{{master_certs_path}}/ca/{{ca_cert_name}}"
|
- "{{ master_certs_path }}/ca/{{ ca_cert_name }}"
|
||||||
when:
|
when:
|
||||||
- not generate_CA
|
- not generate_CA
|
||||||
- filebeat_xpack_security
|
- filebeat_xpack_security
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user