Closed dstevensson closed 1 year ago
Hi @dstevensson
Added a parameter for vmagent to override ProtectHome
at systemd unit. Could you please try to switch to read-only
and verify if it helps?
Closing as resolved for now, feel free to reopen if that won't help.
vmagent skips
gce_sd_config
due to being unable to read credentials location required by the cloud sdk. The cloud SDK steps through multiple ways of accessing credentials, including checking the home directory of the user for a credentials file. Relevant error:The problem lies not in the fact that the role doesn't create the home folder but rather that systemd sandboxing prevents the process from checking whether the file exists at all.
This exact problem has been discussed before in https://github.com/cloudalchemy/ansible-prometheus/issues/153 where the solution was to change
ProtectHome=yes
toProtectHome=read-only
in the systemd unit file. To support cases where a static credentials file is needed, setting it toread-only
is most likely needed. If not, then we can probably get away withProtectHome=tmpfs
. More details onProtectHome
https://www.freedesktop.org/software/systemd/man/systemd.exec.html#ProtectHome=This is the line in question https://github.com/VictoriaMetrics/ansible-playbooks/blob/master/roles/vmagent/templates/vmagent.service.j2#L17