Skip to content

Instantly share code, notes, and snippets.

@alastairhm
Created October 20, 2017 11:01
Show Gist options
  • Save alastairhm/51eb6f8bb35b8d785639c3e3165b41ac to your computer and use it in GitHub Desktop.
Save alastairhm/51eb6f8bb35b8d785639c3e3165b41ac to your computer and use it in GitHub Desktop.
Puppet ERB template for generating Minio cluster systemd control script.
[Unit]
Description=Minio
Documentation=https://docs.minio.io
Wants=network-online.target
After=network-online.target
After=syslog.target network.target
AssertFileIsExecutable=<%= @installation_directory %>/minio
[Service]
WorkingDirectory=<%= @installation_directory %>
Environment="MINIO_ACCESS_KEY=<%= @access_key %>"
Environment="MINIO_SECRET_KEY=<%= @secret_key %>"
User=<%= @owner %>
Group=<%= @group %>
PermissionsStartOnly=true
ExecStart=<%= @installation_directory %>/minio server --config-dir <%= @configuration_directory %> \
<% @cluster_fqdn.each_with_index do |fqdn, i| -%>
<%- unless i < (@cluster_fqdn.size - 1) -%>
http://<%= fqdn %><%= @minio_mount_partition %>/minio-data
<%- else -%>
http://<%= fqdn %><%= @minio_mount_partition %>/minio-data \
<%- end -%>
<% end -%>
StandardOutput=journal
StandardError=inherit
# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536
# Disable timeout logic and wait until process is stopped
TimeoutStopSec=0
# SIGTERM signal is used to stop Minio
KillSignal=SIGTERM
SendSIGKILL=no
SuccessExitStatus=0
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment