Skip to content

Commit c34feb8

Browse files
authored
Allow to set a password for Redis connections (#331)
I hijacked the logstash_pipelines molecule check to test these new settings. fixes #330
1 parent c771c2d commit c34feb8

File tree

7 files changed

+16
-0
lines changed

7 files changed

+16
-0
lines changed

docs/role-logstash.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Aside from `logstash.yml` we can manage Logstashs pipelines.
8787
* *logstash_sniffing_delay*: How long to wait, in seconds, between sniffing attempts (Default: `not set`).
8888
* *logstash_sniffing_path*: HTTP Path to be used for the sniffing requests (Default: `not set`).
8989
* *logstash_legacy_monitoring*: Enables legacy monitoring - ignored when `elasticstack_full_stack` is not set. (default: `true`)
90+
* *logstash_redis_password*: If set this will use this password when connecting our simple inputs and outputs to Redis. (default: not set)
9091

9192
The following variables configure Log4j for Logstash. All default to `true` as this is the default after the installation.
9293

molecule/elasticstack_default/converge.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
elasticstack_full_stack: true
1919
elasticstack_no_log: false
2020
logstash_pipeline_unsafe_shutdown: true
21+
logstash_redis_password: "ThisIsMyRedisTest"
22+
redis_requirepass: "{{ logstash_redis_password }}"
2123
beats_filebeat_syslog_udp: true
2224
beats_filebeat_syslog_tcp: true
2325
beats_filebeat_modules:

molecule/logstash_pipelines/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
logstash_pipeline_identifier_field_name: "[mytest][pipelines]"
3131
logstash_pipeline_identifier_defaults: true
3232
logstash_pipeline_unsafe_shutdown: true
33+
redis_requirepass: "{{ logstash_redis_password }}"
3334
elasticstack_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
3435
elasticstack_full_stack: false
3536
elasticstack_no_log: false

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@ input {
33
host => "localhost"
44
data_type => "list"
55
key => "forwarder"
6+
{% if logstash_redis_password is defined %}
7+
password => "{{ logstash_redis_password }}"
8+
{% endif %}
69
}
710
}

roles/logstash/templates/redis-output.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ output {
1414
data_type => "list"
1515
key => "input"
1616
{% if logstash_beats_input_congestion is defined %} congestion_threshold => {{ logstash_beats_input_congestion }}{% endif %}
17+
{% if logstash_redis_password is defined %}
18+
password => "{{ logstash_redis_password }}"
19+
{% endif %}
1720
}
1821
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ input {
66
host => "localhost"
77
data_type => "list"
88
key => "{{ input.key }}"
9+
{% if logstash_redis_password is defined %}
10+
password => "{{ logstash_redis_password }}"
11+
{% endif %}
912
}
1013
{% endfor %}
1114

roles/logstash/templates/simple-output.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ output {
1919
host => "localhost"
2020
data_type => "list"
2121
key => "{{ output.key }}"
22+
{% if logstash_redis_password is defined %}
23+
password => "{{ logstash_redis_password }}"
24+
{% endif %}
2225
{% if output.congestion is defined %}congestion_threshold => {{ output.congestion }}{% endif %}
2326

2427
}

0 commit comments

Comments
 (0)