feat: add victorialogs module (#374)
- add module for victorialogs - add hieradata for vl insert/select/storage - manage packages, directories, services, etc - manage exporting metrics Reviewed-on: #374
This commit was merged in pull request #374.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<%
|
||||
opts = @options || {}
|
||||
lines = []
|
||||
|
||||
def undefish?(v)
|
||||
v.respond_to?(:strip) && v.strip.downcase == 'undef'
|
||||
end
|
||||
|
||||
opts.each do |key, val|
|
||||
flag = "-#{key}"
|
||||
|
||||
case val
|
||||
when Array
|
||||
need_bare = false
|
||||
val.each do |v|
|
||||
if undefish?(v)
|
||||
need_bare = true
|
||||
else
|
||||
lines << "#{flag}=#{v}"
|
||||
end
|
||||
end
|
||||
lines << flag if need_bare
|
||||
else
|
||||
if undefish?(val)
|
||||
lines << flag
|
||||
else
|
||||
lines << "#{flag}=#{val}"
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
OPTIONS="<%= lines.join(" \\\n ") %>"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=VictoriaMetrics vminsert service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=<%= @user %>
|
||||
Group=<%= @group %>
|
||||
Restart=always
|
||||
EnvironmentFile=<%= @vars_file %>
|
||||
ExecStart=<%= @exec_path %> $OPTIONS
|
||||
|
||||
PrivateTmp=yes
|
||||
NoNewPrivileges=yes
|
||||
ProtectSystem=full
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user