-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement(node_exporter): use systemd to create node_exporter_textfile_dir if it doesn't exist #323
base: main
Are you sure you want to change the base?
enhancement(node_exporter): use systemd to create node_exporter_textfile_dir if it doesn't exist #323
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,16 @@ After=network-online.target | |
Type=simple | ||
User={{ node_exporter_system_user }} | ||
Group={{ node_exporter_system_group }} | ||
{% if node_exporter_textfile_dir | length > 0 %} | ||
{% if (ansible_facts.packages.systemd | first).version is version('235', '>=') %} | ||
ExecStartPre=+/bin/mkdir -p {{ node_exporter_textfile_dir }} | ||
ExecStartPre=+/bin/chown -R {{ node_exporter_system_user }}:{{ node_exporter_system_group }} {{ node_exporter_textfile_dir }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I wonder if this should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In our environment, the text file exporters are started after |
||
{% else %} | ||
ExecStartPre=/bin/mkdir -p {{ node_exporter_textfile_dir }} | ||
ExecStartPre=/bin/chown -R {{ node_exporter_system_user }}:{{ node_exporter_system_group }} {{ node_exporter_textfile_dir }} | ||
PermissionsStartOnly=true | ||
{% endif %} | ||
{% endif %} | ||
ExecStart={{ node_exporter_binary_install_dir }}/node_exporter \ | ||
{% for collector in node_exporter_enabled_collectors -%} | ||
{% if not collector is mapping %} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would affect the common user who does not use tmpfs.