voxpupuli / puppet-elasticsearch

Elasticsearch Puppet module
Apache License 2.0
404 stars 479 forks source link

Manage the elasticsearch service file (systemd) via the elasticsearch module #1078

Open cr-liadsh opened 4 years ago

cr-liadsh commented 4 years ago

Feature Description

The Elasticsearch service systemd file is deployed by the elasticsearch puppet module. At the moment it is not possible to apply systemd directives (https://www.freedesktop.org/software/systemd/man/systemd.directives.html) to the configuration file from the Elasticsearch class.

My workaround right now is updating elasticsearch.systemd.erb:

[Unit] Description=Elasticsearch instance <%= @resource[:instance] %> Documentation=http://www.elastic.co Wants=network-online.target After=network-online.target < my change is the line below > <% if SOME_CONDITION %>AssertPathIsMountPoint=<%= Facter.value('SOME_VALUE') %><% end %>

In my case, I need to make sure that my data dir is mounted on data nodes before I start the service.

Adding a parameter to send these directives to the template will be enough in my opinion, maybe something like this:

[Unit] Description=Elasticsearch instance <%= @resource[:instance] %> Documentation=http://www.elastic.co Wants=network-online.target After=network-online.target <% directives.each do |key,value| -%> <%= key %>=<%= value %> <% end %>

braddeicide commented 3 years ago

You can achieve this with a systemd drop-in in your profile etc.