Skip to content

Allow to set a password for Redis connections #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/role-logstash.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Aside from `logstash.yml` we can manage Logstashs pipelines.
* *logstash_sniffing_delay*: How long to wait, in seconds, between sniffing attempts (Default: `not set`).
* *logstash_sniffing_path*: HTTP Path to be used for the sniffing requests (Default: `not set`).
* *logstash_legacy_monitoring*: Enables legacy monitoring - ignored when `elasticstack_full_stack` is not set. (default: `true`)
* *logstash_redis_password*: If set this will use this password when connecting our simple inputs and outputs to Redis. (default: not set)

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

Expand Down
2 changes: 2 additions & 0 deletions molecule/elasticstack_default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
elasticstack_full_stack: true
elasticstack_no_log: false
logstash_pipeline_unsafe_shutdown: true
logstash_redis_password: "ThisIsMyRedisTest"
redis_requirepass: "{{ logstash_redis_password }}"
beats_filebeat_syslog_udp: true
beats_filebeat_syslog_tcp: true
beats_filebeat_modules:
Expand Down
1 change: 1 addition & 0 deletions molecule/logstash_pipelines/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
logstash_pipeline_identifier_field_name: "[mytest][pipelines]"
logstash_pipeline_identifier_defaults: true
logstash_pipeline_unsafe_shutdown: true
redis_requirepass: "{{ logstash_redis_password }}"
elasticstack_release: "{{ lookup('env', 'ELASTIC_RELEASE') | int}}"
elasticstack_full_stack: false
elasticstack_no_log: false
Expand Down
3 changes: 3 additions & 0 deletions roles/logstash/templates/redis-input.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ input {
host => "localhost"
data_type => "list"
key => "forwarder"
{% if logstash_redis_password is defined %}
password => "{{ logstash_redis_password }}"
{% endif %}
}
}
3 changes: 3 additions & 0 deletions roles/logstash/templates/redis-output.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ output {
data_type => "list"
key => "input"
{% if logstash_beats_input_congestion is defined %} congestion_threshold => {{ logstash_beats_input_congestion }}{% endif %}
{% if logstash_redis_password is defined %}
password => "{{ logstash_redis_password }}"
{% endif %}
}
}
3 changes: 3 additions & 0 deletions roles/logstash/templates/simple-input.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ input {
host => "localhost"
data_type => "list"
key => "{{ input.key }}"
{% if logstash_redis_password is defined %}
password => "{{ logstash_redis_password }}"
{% endif %}
}
{% endfor %}

Expand Down
3 changes: 3 additions & 0 deletions roles/logstash/templates/simple-output.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ output {
host => "localhost"
data_type => "list"
key => "{{ output.key }}"
{% if logstash_redis_password is defined %}
password => "{{ logstash_redis_password }}"
{% endif %}
{% if output.congestion is defined %}congestion_threshold => {{ output.congestion }}{% endif %}

}
Expand Down