diff --git a/elk_metrics_7x/roles/elastic_apm_server/defaults/main.yml b/elk_metrics_7x/roles/elastic_apm_server/defaults/main.yml index 7b38493e..f39b657a 100644 --- a/elk_metrics_7x/roles/elastic_apm_server/defaults/main.yml +++ b/elk_metrics_7x/roles/elastic_apm_server/defaults/main.yml @@ -17,3 +17,6 @@ apm_interface: 0.0.0.0 apm_port: 8200 apm_token: SuperSecrete +# Manually define Kibana targets. +# Default: hosts from Ansible `kibana` group will be used +apm_kibana_target: "{{ kibana_target | default('') }}" diff --git a/elk_metrics_7x/roles/elastic_apm_server/templates/apm-server.yml.j2 b/elk_metrics_7x/roles/elastic_apm_server/templates/apm-server.yml.j2 index c61df4ff..bf241f20 100644 --- a/elk_metrics_7x/roles/elastic_apm_server/templates/apm-server.yml.j2 +++ b/elk_metrics_7x/roles/elastic_apm_server/templates/apm-server.yml.j2 @@ -258,56 +258,10 @@ apm-server: # Specify cache key expiration via this setting. Default is 30 seconds. #agent.config.cache.expiration: 30s -{% if (groups['kibana'] | length) > 0 %} - kibana: - # For APM Agent configuration in Kibana, enabled must be true. - enabled: true - - # Scheme and port can be left out and will be set to the default (`http` and `5601`). - # In case you specify an additional path, the scheme is required: `http://localhost:5601/path`. - # IPv6 addresses should always be defined as: `https://[2001:db8::1]:5601`. - host: {{ hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port }} - - # Optional protocol and basic auth credentials. - #protocol: "https" - #username: "elastic" - #password: "changeme" - - # Optional HTTP path. - #path: "" - - # Enable custom SSL settings. Set to false to ignore custom SSL settings for secure communication. - #ssl.enabled: true - - # Optional SSL configuration options. SSL is off by default, change the `protocol` option if you want to enable `https`. - # Configure SSL verification mode. If `none` is configured, all server hosts - # and certificates will be accepted. In this mode, SSL based connections are - # susceptible to man-in-the-middle attacks. Use only for testing. Default is - # `full`. - #ssl.verification_mode: full - - # List of supported/valid TLS versions. By default all TLS versions 1.0 up to - # 1.2 are enabled. - #ssl.supported_protocols: [TLSv1.0, TLSv1.1, TLSv1.2] - - # List of root certificates for HTTPS server verifications. - #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"] - - # Certificate for SSL client authentication. - #ssl.certificate: "/etc/pki/client/cert.pem" - - # Client Certificate Key - #ssl.key: "/etc/pki/client/cert.key" - - # Optional passphrase for decrypting the Certificate Key. - # It is recommended to use the provided keystore instead of entering the passphrase in plain text. - #ssl.key_passphrase: '' - - # Configure cipher suites to be used for SSL connections. - #ssl.cipher_suites: [] - - # Configure curve types for ECDHE based cipher suites. - #ssl.curve_types: [] +{% if apm_kibana_target %} +{{ elk_macros.setup_kibana(apm_kibana_target) }} +{% elif (groups['kibana'] | length) > 0 %} +{{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }} {% endif %} #---------------------------- APM Server - ILM Index Lifecycle Management ---------------------------- diff --git a/elk_metrics_7x/roles/elastic_auditbeat/defaults/main.yml b/elk_metrics_7x/roles/elastic_auditbeat/defaults/main.yml index 73e8ecb1..9b58975a 100644 --- a/elk_metrics_7x/roles/elastic_auditbeat/defaults/main.yml +++ b/elk_metrics_7x/roles/elastic_auditbeat/defaults/main.yml @@ -20,6 +20,10 @@ auditbeat_ilm_policy_template: "auditbeat-{{ beat_version }}" auditbeat_ilm_policy_filename: "auditbeat-ilm-policy.json" auditbeat_ilm_policy_file_location: "/etc/auditbeat" +# Manually define Kibana targets. +# Default: hosts from Ansible `kibana` group will be used +auditbeat_kibana_target: "{{ kibana_target | default('') }}" + ilm_policy_name: "{{ auditbeat_ilm_policy_name | default('') }}" ilm_policy: "{{ (auditbeat_ilm_policy | default(default_ilm_policy)) | default({}) }}" ilm_policy_template: "{{ auditbeat_ilm_policy_template | default('') }}" diff --git a/elk_metrics_7x/roles/elastic_auditbeat/templates/auditbeat.yml.j2 b/elk_metrics_7x/roles/elastic_auditbeat/templates/auditbeat.yml.j2 index dc3f5347..47d6f60e 100644 --- a/elk_metrics_7x/roles/elastic_auditbeat/templates/auditbeat.yml.j2 +++ b/elk_metrics_7x/roles/elastic_auditbeat/templates/auditbeat.yml.j2 @@ -1146,7 +1146,9 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }} # =================================== Kibana =================================== -{% if (groups['kibana'] | length) > 0 %} +{% if auditbeat_kibana_target %} +{{ elk_macros.setup_kibana(auditbeat_kibana_target) }} +{% elif (groups['kibana'] | length) > 0 %} {{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }} {% endif %} diff --git a/elk_metrics_7x/roles/elastic_filebeat/defaults/main.yml b/elk_metrics_7x/roles/elastic_filebeat/defaults/main.yml index 1f076a38..32ac9114 100644 --- a/elk_metrics_7x/roles/elastic_filebeat/defaults/main.yml +++ b/elk_metrics_7x/roles/elastic_filebeat/defaults/main.yml @@ -295,6 +295,10 @@ filebeat_ilm_policy_template: "filebeat-{{ beat_version }}" filebeat_ilm_policy_filename: "filebeat-ilm-policy.json" filebeat_ilm_policy_file_location: "/etc/filebeat" +# Manually define Kibana targets. +# Default: hosts from Ansible `kibana` group will be used +filebeat_kibana_target: "{{ kibana_target | default('') }}" + ilm_policy_name: "{{ filebeat_ilm_policy_name | default('') }}" ilm_policy: "{{ (filebeat_ilm_policy | default(default_ilm_policy)) | default({}) }}" ilm_policy_template: "{{ filebeat_ilm_policy_template | default('') }}" diff --git a/elk_metrics_7x/roles/elastic_filebeat/templates/filebeat.yml.j2 b/elk_metrics_7x/roles/elastic_filebeat/templates/filebeat.yml.j2 index 8d9fef4c..97503b51 100644 --- a/elk_metrics_7x/roles/elastic_filebeat/templates/filebeat.yml.j2 +++ b/elk_metrics_7x/roles/elastic_filebeat/templates/filebeat.yml.j2 @@ -2039,7 +2039,9 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }} # =================================== Kibana =================================== -{% if (groups['kibana'] | length) > 0 %} +{% if filebeat_kibana_target %} +{{ elk_macros.setup_kibana(filebeat_kibana_target) }} +{% elif (groups['kibana'] | length) > 0 %} {{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }} {% endif %} diff --git a/elk_metrics_7x/roles/elastic_heartbeat/defaults/main.yml b/elk_metrics_7x/roles/elastic_heartbeat/defaults/main.yml index a798d6f1..52141891 100644 --- a/elk_metrics_7x/roles/elastic_heartbeat/defaults/main.yml +++ b/elk_metrics_7x/roles/elastic_heartbeat/defaults/main.yml @@ -16,10 +16,14 @@ heartbeat_service_state: restarted heartbeat_ilm_policy_name: "heartbeat-{{ beat_version }}" -heartbeat_ilm_policy_template: "heartbeat-{{ beat_version}}" +heartbeat_ilm_policy_template: "heartbeat-{{ beat_version }}" heartbeat_ilm_policy_filename: "heartbeat-ilm-policy.json" heartbeat_ilm_policy_file_location: "/etc/heartbeat" +# Manually define Kibana targets. +# Default: hosts from Ansible `kibana` group will be used +heartbeat_kibana_target: "{{ kibana_target | default('') }}" + ilm_policy_name: "{{ heartbeat_ilm_policy_name | default('') }}" ilm_policy: "{{ (heartbeat_ilm_policy | default(default_ilm_policy)) | default({}) }}" ilm_policy_template: "{{ heartbeat_ilm_policy_template | default('') }}" diff --git a/elk_metrics_7x/roles/elastic_heartbeat/templates/heartbeat.yml.j2 b/elk_metrics_7x/roles/elastic_heartbeat/templates/heartbeat.yml.j2 index 6a9f1b1e..bef1ae9d 100644 --- a/elk_metrics_7x/roles/elastic_heartbeat/templates/heartbeat.yml.j2 +++ b/elk_metrics_7x/roles/elastic_heartbeat/templates/heartbeat.yml.j2 @@ -1273,7 +1273,9 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }} # =================================== Kibana =================================== -{% if (groups['kibana'] | length) > 0 %} +{% if heartbeat_kibana_target %} +{{ elk_macros.setup_kibana(heartbeat_kibana_target) }} +{% elif (groups['kibana'] | length) > 0 %} {{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }} {% endif %} diff --git a/elk_metrics_7x/roles/elastic_journalbeat/defaults/main.yml b/elk_metrics_7x/roles/elastic_journalbeat/defaults/main.yml index 5fe93c83..e97dfba2 100644 --- a/elk_metrics_7x/roles/elastic_journalbeat/defaults/main.yml +++ b/elk_metrics_7x/roles/elastic_journalbeat/defaults/main.yml @@ -20,6 +20,10 @@ journalbeat_ilm_policy_template: "journalbeat-{{ beat_version }}" journalbeat_ilm_policy_filename: "journalbeat-ilm-policy.json" journalbeat_ilm_policy_file_location: "/etc/journalbeat" +# Manually define Kibana targets. +# Default: hosts from Ansible `kibana` group will be used +journalbeat_kibana_target: "{{ kibana_target | default('') }}" + ilm_policy_name: "{{ journalbeat_ilm_policy_name | default('') }}" ilm_policy: "{{ (journalbeat_ilm_policy | default(default_ilm_policy)) | default({}) }}" ilm_policy_template: "{{ journalbeat_ilm_policy_template | default('') }}" diff --git a/elk_metrics_7x/roles/elastic_journalbeat/templates/journalbeat.yml.j2 b/elk_metrics_7x/roles/elastic_journalbeat/templates/journalbeat.yml.j2 index a1c31c81..4c47ea2f 100644 --- a/elk_metrics_7x/roles/elastic_journalbeat/templates/journalbeat.yml.j2 +++ b/elk_metrics_7x/roles/elastic_journalbeat/templates/journalbeat.yml.j2 @@ -1010,7 +1010,9 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }} # =================================== Kibana =================================== -{% if (groups['kibana'] | length) > 0 %} +{% if journalbeat_kibana_target %} +{{ elk_macros.setup_kibana(journalbeat_kibana_target) }} +{% elif (groups['kibana'] | length) > 0 %} {{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }} {% endif %} diff --git a/elk_metrics_7x/roles/elastic_metricbeat/defaults/main.yml b/elk_metrics_7x/roles/elastic_metricbeat/defaults/main.yml index 97bf0bcf..febaccd0 100644 --- a/elk_metrics_7x/roles/elastic_metricbeat/defaults/main.yml +++ b/elk_metrics_7x/roles/elastic_metricbeat/defaults/main.yml @@ -26,6 +26,10 @@ ceph_metricbeat_group: cinder_volume # Include default kibana dashboards setup_kibana_dashboards: true +# Manually define Kibana targets. +# Default: hosts from Ansible `kibana` group will be used +metricbeat_kibana_target: "{{ kibana_target | default('') }}" + metricbeat_ilm_policy_name: "metricbeat-{{ beat_version }}" metricbeat_ilm_policy_template: "metricbeat-{{ beat_version }}" metricbeat_ilm_policy_filename: "metricbeat-ilm-policy.json" diff --git a/elk_metrics_7x/roles/elastic_metricbeat/templates/metricbeat.yml.j2 b/elk_metrics_7x/roles/elastic_metricbeat/templates/metricbeat.yml.j2 index 32496e13..d38bba68 100644 --- a/elk_metrics_7x/roles/elastic_metricbeat/templates/metricbeat.yml.j2 +++ b/elk_metrics_7x/roles/elastic_metricbeat/templates/metricbeat.yml.j2 @@ -1907,7 +1907,9 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }} # =================================== Kibana =================================== -{% if (groups['kibana'] | length) > 0 and (setup_kibana_dashboards | default(true)) %} +{% if metricbeat_kibana_target %} +{{ elk_macros.setup_kibana(metricbeat_kibana_target) }} +{% elif (groups['kibana'] | length) > 0 and (setup_kibana_dashboards | default(true)) %} {{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }} {% endif %} diff --git a/elk_metrics_7x/roles/elastic_packetbeat/defaults/main.yml b/elk_metrics_7x/roles/elastic_packetbeat/defaults/main.yml index 4a76df09..25f66ae6 100644 --- a/elk_metrics_7x/roles/elastic_packetbeat/defaults/main.yml +++ b/elk_metrics_7x/roles/elastic_packetbeat/defaults/main.yml @@ -20,6 +20,10 @@ packetbeat_ilm_policy_template: "packetbeat-{{ beat_version }}" packetbeat_ilm_policy_filename: "packetbeat-ilm-policy.json" packetbeat_ilm_policy_file_location: "/etc/packetbeat" +# Manually define Kibana targets. +# Default: hosts from Ansible `kibana` group will be used +packetbeat_kibana_target: "{{ kibana_target | default('') }}" + ilm_policy_name: "{{ packetbeat_ilm_policy_name | default('') }}" ilm_policy: "{{ (packetbeat_ilm_policy | default(default_ilm_policy)) | default({}) }}" ilm_policy_template: "{{ packetbeat_ilm_policy_template | default('') }}" diff --git a/elk_metrics_7x/roles/elastic_packetbeat/templates/packetbeat.yml.j2 b/elk_metrics_7x/roles/elastic_packetbeat/templates/packetbeat.yml.j2 index 2f8bb70a..ed97e855 100644 --- a/elk_metrics_7x/roles/elastic_packetbeat/templates/packetbeat.yml.j2 +++ b/elk_metrics_7x/roles/elastic_packetbeat/templates/packetbeat.yml.j2 @@ -1569,7 +1569,9 @@ setup.ilm.policy_file: "{{ ilm_policy_file_location }}/{{ ilm_policy_filename }} # =================================== Kibana =================================== -{% if (groups['kibana'] | length) > 0 %} +{% if packetbeat_kibana_target %} +{{ elk_macros.setup_kibana(packetbeat_kibana_target) }} +{% elif (groups['kibana'] | length) > 0 %} {{ elk_macros.setup_kibana(hostvars[groups['kibana'][0]]['ansible_host'] ~ ':' ~ kibana_port) }} {% endif %}