saltstack-formulas / elasticsearch-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
21 stars 114 forks source link

[BUG] path.data does not support lists #69

Open darkpixel opened 4 years ago

darkpixel commented 4 years ago

Elasticsearch docs support multiple data paths.

The path.data settings can be set to multiple paths, in which case all paths will be used to store data (although the files belonging to a single shard will all be stored on the same data path):

path:
  data:
    - /mnt/elasticsearch_1
    - /mnt/elasticsearch_2
    - /mnt/elasticsearch_3

See: https://www.elastic.co/guide/en/elasticsearch/reference/master/path-settings.html

Attempting to use a list produces the following output:

[CRITICAL] Rendering SLS 'base:elasticsearch.config' failed: while constructing a mapping
  in "<unicode string>", line 1, column 1:
    include:
    ^
found unacceptable key [ScalarNode(tag='tag:yaml.org,2002:str', value='/usr/shar
  in "<unicode string>", line 17, column 1:
    ['/usr/share/elasticsearch/data' ... 
    ^
local:
    Data failed to compile:
----------
    Rendering SLS 'base:elasticsearch.config' failed: while constructing a mappi
  in "<unicode string>", line 1, column 1:
    include:
    ^
found unacceptable key [ScalarNode(tag='tag:yaml.org,2002:str', value='/usr/shar
  in "<unicode string>", line 17, column 1:
    ['/usr/share/elasticsearch/data' ... 
    ^
myii commented 4 years ago

Thanks for the report @darkpixel.

Relevant parts of the formula to be adjusted:

https://github.com/saltstack-formulas/elasticsearch-formula/blob/dea47030b460779e7d11690887fd19539da623cb/pillar.example#L8-L9

https://github.com/saltstack-formulas/elasticsearch-formula/blob/2cbe705c0ff37ec2b8131b5b8e15534d71863a97/elasticsearch/config.sls#L15-L19