Skip to content

Commit 551f75c

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Allow to supply custom kibana backend to roles"
2 parents 331d481 + e013623 commit 551f75c

File tree

14 files changed

+50
-57
lines changed

14 files changed

+50
-57
lines changed

elk_metrics_7x/roles/elastic_apm_server/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@
1717
apm_interface: 0.0.0.0
1818
apm_port: 8200
1919
apm_token: SuperSecrete
20+
# Manually define Kibana targets.
21+
# Default: hosts from Ansible `kibana` group will be used
22+
apm_kibana_target: "{{ kibana_target | default('') }}"

elk_metrics_7x/roles/elastic_apm_server/templates/apm-server.yml.j2

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -258,56 +258,10 @@ apm-server:
258258
# Specify cache key expiration via this setting. Default is 30 seconds.
259259
#agent.config.cache.expiration: 30s
260260

261-
{% if (groups['kibana'] | length) > 0 %}
262-
kibana:
263-
# For APM Agent configuration in Kibana, enabled must be true.
264-
enabled: true
265-
266-
# Scheme and port can be left out and will be set to the default (`http` and `5601`).
267-
# In case you specify an additional path, the scheme is required: `http://localhost:5601/path`.
268-
# IPv6 addresses should always be defined as: `https://[2001:db8::1]:5601`.
269-
host: {{ hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port }}
270-
271-
# Optional protocol and basic auth credentials.
272-
#protocol: "https"
273-
#username: "elastic"
274-
#password: "changeme"
275-
276-
# Optional HTTP path.
277-
#path: ""
278-
279-
# Enable custom SSL settings. Set to false to ignore custom SSL settings for secure communication.
280-
#ssl.enabled: true
281-
282-
# Optional SSL configuration options. SSL is off by default, change the `protocol` option if you want to enable `https`.
283-
# Configure SSL verification mode. If `none` is configured, all server hosts
284-
# and certificates will be accepted. In this mode, SSL based connections are
285-
# susceptible to man-in-the-middle attacks. Use only for testing. Default is
286-
# `full`.
287-
#ssl.verification_mode: full
288-
289-
# List of supported/valid TLS versions. By default all TLS versions 1.0 up to
290-
# 1.2 are enabled.
291-
#ssl.supported_protocols: [TLSv1.0, TLSv1.1, TLSv1.2]
292-
293-
# List of root certificates for HTTPS server verifications.
294-
#ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
295-
296-
# Certificate for SSL client authentication.
297-
#ssl.certificate: "/etc/pki/client/cert.pem"
298-
299-
# Client Certificate Key
300-
#ssl.key: "/etc/pki/client/cert.key"
301-
302-
# Optional passphrase for decrypting the Certificate Key.
303-
# It is recommended to use the provided keystore instead of entering the passphrase in plain text.
304-
#ssl.key_passphrase: ''
305-
306-
# Configure cipher suites to be used for SSL connections.
307-
#ssl.cipher_suites: []
308-
309-
# Configure curve types for ECDHE based cipher suites.
310-
#ssl.curve_types: []
261+
{% if apm_kibana_target %}
262+
{{ elk_macros.setup_kibana(apm_kibana_target) }}
263+
{% elif (groups['kibana'] | length) > 0 %}
264+
{{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }}
311265
{% endif %}
312266
#---------------------------- APM Server - ILM Index Lifecycle Management ----------------------------
313267

elk_metrics_7x/roles/elastic_auditbeat/defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ auditbeat_ilm_policy_template: "auditbeat-{{ beat_version }}"
2020
auditbeat_ilm_policy_filename: "auditbeat-ilm-policy.json"
2121
auditbeat_ilm_policy_file_location: "/etc/auditbeat"
2222

23+
# Manually define Kibana targets.
24+
# Default: hosts from Ansible `kibana` group will be used
25+
auditbeat_kibana_target: "{{ kibana_target | default('') }}"
26+
2327
ilm_policy_name: "{{ auditbeat_ilm_policy_name | default('') }}"
2428
ilm_policy: "{{ (auditbeat_ilm_policy | default(default_ilm_policy)) | default({}) }}"
2529
ilm_policy_template: "{{ auditbeat_ilm_policy_template | default('') }}"

elk_metrics_7x/roles/elastic_auditbeat/templates/auditbeat.yml.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,9 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }}
11461146

11471147
# =================================== Kibana ===================================
11481148

1149-
{% if (groups['kibana'] | length) > 0 %}
1149+
{% if auditbeat_kibana_target %}
1150+
{{ elk_macros.setup_kibana(auditbeat_kibana_target) }}
1151+
{% elif (groups['kibana'] | length) > 0 %}
11501152
{{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }}
11511153
{% endif %}
11521154

elk_metrics_7x/roles/elastic_filebeat/defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ filebeat_ilm_policy_template: "filebeat-{{ beat_version }}"
295295
filebeat_ilm_policy_filename: "filebeat-ilm-policy.json"
296296
filebeat_ilm_policy_file_location: "/etc/filebeat"
297297

298+
# Manually define Kibana targets.
299+
# Default: hosts from Ansible `kibana` group will be used
300+
filebeat_kibana_target: "{{ kibana_target | default('') }}"
301+
298302
ilm_policy_name: "{{ filebeat_ilm_policy_name | default('') }}"
299303
ilm_policy: "{{ (filebeat_ilm_policy | default(default_ilm_policy)) | default({}) }}"
300304
ilm_policy_template: "{{ filebeat_ilm_policy_template | default('') }}"

elk_metrics_7x/roles/elastic_filebeat/templates/filebeat.yml.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,9 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }}
20392039

20402040
# =================================== Kibana ===================================
20412041

2042-
{% if (groups['kibana'] | length) > 0 %}
2042+
{% if filebeat_kibana_target %}
2043+
{{ elk_macros.setup_kibana(filebeat_kibana_target) }}
2044+
{% elif (groups['kibana'] | length) > 0 %}
20432045
{{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }}
20442046
{% endif %}
20452047

elk_metrics_7x/roles/elastic_heartbeat/defaults/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@
1616
heartbeat_service_state: restarted
1717

1818
heartbeat_ilm_policy_name: "heartbeat-{{ beat_version }}"
19-
heartbeat_ilm_policy_template: "heartbeat-{{ beat_version}}"
19+
heartbeat_ilm_policy_template: "heartbeat-{{ beat_version }}"
2020
heartbeat_ilm_policy_filename: "heartbeat-ilm-policy.json"
2121
heartbeat_ilm_policy_file_location: "/etc/heartbeat"
2222

23+
# Manually define Kibana targets.
24+
# Default: hosts from Ansible `kibana` group will be used
25+
heartbeat_kibana_target: "{{ kibana_target | default('') }}"
26+
2327
ilm_policy_name: "{{ heartbeat_ilm_policy_name | default('') }}"
2428
ilm_policy: "{{ (heartbeat_ilm_policy | default(default_ilm_policy)) | default({}) }}"
2529
ilm_policy_template: "{{ heartbeat_ilm_policy_template | default('') }}"

elk_metrics_7x/roles/elastic_heartbeat/templates/heartbeat.yml.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,9 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }}
12731273

12741274
# =================================== Kibana ===================================
12751275

1276-
{% if (groups['kibana'] | length) > 0 %}
1276+
{% if heartbeat_kibana_target %}
1277+
{{ elk_macros.setup_kibana(heartbeat_kibana_target) }}
1278+
{% elif (groups['kibana'] | length) > 0 %}
12771279
{{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }}
12781280
{% endif %}
12791281

elk_metrics_7x/roles/elastic_journalbeat/defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ journalbeat_ilm_policy_template: "journalbeat-{{ beat_version }}"
2020
journalbeat_ilm_policy_filename: "journalbeat-ilm-policy.json"
2121
journalbeat_ilm_policy_file_location: "/etc/journalbeat"
2222

23+
# Manually define Kibana targets.
24+
# Default: hosts from Ansible `kibana` group will be used
25+
journalbeat_kibana_target: "{{ kibana_target | default('') }}"
26+
2327
ilm_policy_name: "{{ journalbeat_ilm_policy_name | default('') }}"
2428
ilm_policy: "{{ (journalbeat_ilm_policy | default(default_ilm_policy)) | default({}) }}"
2529
ilm_policy_template: "{{ journalbeat_ilm_policy_template | default('') }}"

elk_metrics_7x/roles/elastic_journalbeat/templates/journalbeat.yml.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,9 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }}
10101010

10111011
# =================================== Kibana ===================================
10121012

1013-
{% if (groups['kibana'] | length) > 0 %}
1013+
{% if journalbeat_kibana_target %}
1014+
{{ elk_macros.setup_kibana(journalbeat_kibana_target) }}
1015+
{% elif (groups['kibana'] | length) > 0 %}
10141016
{{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }}
10151017
{% endif %}
10161018

0 commit comments

Comments
 (0)