Update Filebeat certificate imports

This commit is contained in:
Jose M 2019-07-30 17:44:37 +02:00
parent a305d4ff6f
commit c6e14f23a0

View File

@ -26,55 +26,14 @@
tags: tags:
- init - init
- name: Check if certificate exists locally - name: Copying node's certificate from master
stat: copy:
path: "{{ node_certs_destination }}/{{ filebeat_node_name }}.crt" src: "{{item}}"
register: certificate_file_exists
when:
- filebeat_xpack_security
- name: Copy key & certificate files in generator node (locally)
synchronize:
src: "{{ node_certs_source }}/{{ filebeat_node_name }}/"
dest: "{{node_certs_destination}}/" dest: "{{node_certs_destination}}/"
delegate_to: "{{ node_certs_generator_ip }}" with_items:
when: - "{{master_certs_destination}}/{{filebeat_node_name}}/{{ filebeat_node_name }}.key"
- node_certs_generator - "{{master_certs_destination}}/{{filebeat_node_name}}/{{ filebeat_node_name }}.crt"
- filebeat_xpack_security - "{{master_certs_destination}}/ca/ca.crt"
- not certificate_file_exists.stat.exists
tags: xpack-security
- name: Copy ca certificate file in generator node (locally)
synchronize:
src: "{{ node_certs_source }}/ca/"
dest: "{{ node_certs_destination }}/"
delegate_to: "{{ node_certs_generator_ip }}"
when:
- node_certs_generator
- filebeat_xpack_security
- not certificate_file_exists.stat.exists
register: check_certs_permissions
tags: xpack-security
- name: Importing key & certificate files from generator node
command: >-
{{ rsync_path }} {{ rsync_extra_parameters }} {{ rsync_user }}@{{ node_certs_generator_ip }}:
{{ node_certs_source }}/{{ filebeat_node_name }}/ {{ node_certs_destination }}/
when:
- not node_certs_generator
- filebeat_xpack_security
- not certificate_file_exists.stat.exists
tags: xpack-security
- name: Importing ca certificate file from generator node
command: >-
{{ rsync_path }} {{ rsync_extra_parameters }} {{ rsync_user }}@{{ node_certs_generator_ip }}:
{{ node_certs_source }}/ca/ {{ node_certs_destination }}/
when:
- not node_certs_generator
- filebeat_xpack_security
- not certificate_file_exists.stat.exists
register: check_certs_permissions
tags: xpack-security tags: xpack-security
- name: Ensuring certificates folder owner - name: Ensuring certificates folder owner