Open widhalmt opened 8 months ago
Would it be a cleaner solution to have two templates? ie elasticsearch-7.yml.j2
and elasticsearch-8.yml.j2
. Some changes would have to be done twice, but I think the template files would be easier to read.
I think the only required change to other files would be changing src line in Configure Elasticsearch , but I haven't tested it.
src: elasticsearch-{{ elasticstack_release }}.yml.j2
The check in https://github.com/NETWAYS/ansible-collection-elasticstack/blob/main/roles/elasticsearch/templates/elasticsearch.yml.j2#L31 is wrong at least for Elasticsearch 7. Even a single node cluster needs this to be set.
If I remember correctly, we had to remove it on Elasticsearch 8 single node clusters to not get error messages. So either we live with the message or we introduce yet another check and set it always on 7 and only on multinode cluster on 8.