[Unit]
Description=Elasticsearch Keystore Generation
ConditionPathExists=|!/etc/elasticsearch/%I/elasticsearch.keystore

[Service]
Type=oneshot
Group=elasticsearch
UMask=0007
Environment=ES_PATH_CONF=/etc/elasticsearch/%I
ExecStart=/usr/share/elasticsearch/bin/elasticsearch-keystore create
RemainAfterExit=yes