Skip to content

Commit 7837a2f

Browse files
widhalmttbauriedel
authored andcommitted
Set passphrase for beats tls key
Side effect: Includes extra changes for listing names of pipelines in task names fixes #291
1 parent 185a01f commit 7837a2f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

roles/logstash/tasks/logstash-security.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
-topk8
305305
-passin pass:{{ logstash_tls_key_passphrase }}
306306
-out {{ logstash_certs_dir }}/{{ inventory_hostname }}-pkcs8.key
307-
-nocrypt
307+
-passout pass:{{ logstash_tls_key_passphrase }}
308308
args:
309309
creates: "{{ logstash_certs_dir }}/{{ inventory_hostname }}-pkcs8.key"
310310
no_log: "{{ elasticstack_no_log }}"

roles/logstash/tasks/manage_pipeline.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22

3-
- name: Check if Logstash pipeline already exists
3+
- name: Check if Logstash pipeline {{ pipelinename.name }} already exists
44
ansible.builtin.stat:
55
path: "/etc/logstash/conf.d/{{ pipelinename.name }}"
66
register: "logstash_pipeline_stat"
77

8-
- name: Check who managed pipeline in last run # noqa: risky-shell-pipe
8+
- name: Check who managed pipeline {{ pipelinename.name }} in last run # noqa: risky-shell-pipe
99
ansible.builtin.shell: >
1010
if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi;
1111
grep -e '^# source:{{ pipelinename.name }}' /etc/logstash/pipelines.yml |
@@ -16,7 +16,7 @@
1616
- logstash_pipeline_stat.stat.exists | bool
1717
- logstash_pipeline_stat.stat.isdir | bool
1818

19-
- name: Delete directory if changing manager
19+
- name: Delete directory if changing manager of pipeline {{ pipelinename.name }}
2020
ansible.builtin.file:
2121
path: "/etc/logstash/conf.d/{{ pipelinename.name }}"
2222
state: absent
@@ -25,15 +25,15 @@
2525
- logstash_pipeline_manager.stdout == "local"
2626
- pipelinename.source is defined
2727

28-
- name: Create Logstash pipeline directories
28+
- name: Create Logstash pipeline {{ pipelinename.name }} directory
2929
ansible.builtin.file:
3030
path: "/etc/logstash/conf.d/{{ pipelinename.name }}"
3131
state: directory
3232
owner: root
3333
group: root
3434
mode: 0755
3535

36-
- name: Check out pipeline configuration
36+
- name: Check out pipeline configuration for {{ pipelinename.name }}
3737
ansible.builtin.git:
3838
repo: "{{ pipelinename.source }}"
3939
dest: "/etc/logstash/conf.d/{{ pipelinename.name }}"
@@ -42,7 +42,7 @@
4242
notify:
4343
- Restart Logstash noauto
4444

45-
- name: Create simple input
45+
- name: Create simple input for {{ pipelinename.name }}
4646
ansible.builtin.template:
4747
src: simple-input.conf.j2
4848
dest: "/etc/logstash/conf.d/{{ pipelinename.name }}\
@@ -54,7 +54,7 @@
5454
notify:
5555
- Restart Logstash noauto
5656

57-
- name: Create simple output
57+
- name: Create simple output for {{ pipelinename.name }}
5858
ansible.builtin.template:
5959
src: simple-output.conf.j2
6060
dest: "/etc/logstash/conf.d/{{ pipelinename.name }}\

roles/logstash/templates/beats-input.conf.j2

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ input {
88
ssl_verify_mode => force_peer
99
ssl_certificate_authorities => ["{{ logstash_certs_dir }}/ca.crt"]
1010
ssl_peer_metadata => false
11+
ssl_key_passphrase => "{{ logstash_tls_key_passphrase }}"
1112
{% endif %}
1213
{% if logstash_beats_timeout is defined %}
1314
client_inactivity_timeout => "{{ logstash_beats_timeout }}"

0 commit comments

Comments
 (0)