Skip to content

Commit

Permalink
modify and organize variables
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi8080 committed Jul 8, 2024
1 parent 7a9e55d commit 74aac1f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 50 deletions.
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ elastic_config:
logs: /var/log/elasticsearch
xpack:
security:
enabled: true
hide_settings: 'xpack.security.authc.realms.native.*'
enabled: false
# Elastic configuration in the form of a yaml array with non-collapsed keys.
# The `elastic_config` array will be output as is into the
# `/etc/elasticsearch/elasticsearch.yml` file. For what these settings do,
Expand Down
38 changes: 38 additions & 0 deletions molecule/default/converge-vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---

elastic_bind_host: 0.0.0.0
elastic_cluster_name: watchmen
elastic_node_name: nite-owl
elastic_jvm_extra_config: |
-Des.enforce.bootstrap.checks=true
elastic_certificates_password: 'nk}$Q%];a3Gy$E!QvT8E'
elastic_certificates:
ca: "~/pki/ca.crt"
crt: "~/pki/issued/elastic.crt"
key: "~/pki/private/elastic.key"
elastic_certificates_dir: /etc/elasticsearch/certs/
elastic_builtin_users_set_random_passwords: true
elastic_builtin_users_password_backup_file: ~/elastic-passwords
template_files:
# When using logstash in front of kibana and you use elastic beats to send
# data to logstash (which will then be forwarded to elastic), you will
# need to manually load the index templates that come with the elastic
# beats. The `nkakouros.beats` role allow you to extract the index
# template into a json file. Here, we read the paths on the ansible
# controller where these json files are located in order for the
# `nkakouros.elastic` role to insert them into elasticsearch.
"{{ q('fileglob', '~/elk/beats/*.json') }}"
elastic_index_templates: >-
[
{%- for file in template_files -%}
{
'file': '{{ file }}',
'name': '{{
file
| basename
| regex_replace('^([^.]+\.[0-9]+\.[0-9]+\.[0-9]+)\..*$', '\1')
| replace('.', '-', count=1)
}}'
},
{%- endfor -%}
]
51 changes: 2 additions & 49 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,5 @@
hosts: all
roles:
- nkakouros.elasticsearch
vars:
elastic_bind_host: 0.0.0.0
elastic_cluster_name: watchmen
elastic_node_name: nite-owl
elastic_jvm_extra_config: |
-Des.enforce.bootstrap.checks=true
elastic_certificates_password: 'nk}$Q%];a3Gy$E!QvT8E'
elastic_certificates:
ca: "~/pki/ca.crt"
crt: "~/pki/issued/elastic.crt"
key: "~/pki/private/elastic.key"
elastic_certificates_dir: /etc/elasticsearch/certs/
elastic_builtin_users_set_random_passwords: true
elastic_builtin_users_password_backup_file: ~/elastic-passwords
elastic_config:
xpack:
security:
hide_settings: 'xpack.security.authc.realms.native.*'
enabled: false
# authc:
# accept_default_password: false
# realms:
# native:
# native1:
# enabled: true
# order: 0
template_files:
# When using logstash in front of kibana and you use elastic beats to send
# data to logstash (which will then be forwarded to elastic), you will
# need to manually load the index templates that come with the elastic
# beats. The `nkakouros.beats` role allow you to extract the index
# template into a json file. Here, we read the paths on the ansible
# controller where these json files are located in order for the
# `nkakouros.elastic` role to insert them into elasticsearch.
"{{ q('fileglob', '~/elk/beats/*.json') }}"
elastic_index_templates: >-
[
{%- for file in template_files -%}
{
'file': '{{ file }}',
'name': '{{
file
| basename
| regex_replace('^([^.]+\.[0-9]+\.[0-9]+\.[0-9]+)\..*$', '\1')
| replace('.', '-', count=1)
}}'
},
{%- endfor -%}
]
vars_files:
- converge-vars.yml

0 comments on commit 74aac1f

Please sign in to comment.