-
Notifications
You must be signed in to change notification settings - Fork 138
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
fix: node_exporter - Fix Systemd ProtectHome option in service unit #94
Conversation
Some testing at the REPL:
|
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.
Thanks, it'd be good to add a test for the correct ProtectHome value in the molecule tests.
I think I understand how to add a molecule test to ensure the service file exists or has the right contents (something like https://github.com/prometheus-community/ansible/blob/5a3968dd207a249b0841bf3e45000ac52f4ec991/roles/prometheus/molecule/alternative/tests/test_alternative.py#LL24C1-L35C21) but I'm not sure how to actually test this. Three machines would need to be spun up:
|
Yea, I was looking for some simple pytest options to assert "line in file", but I didn't find anything reasonable in the docs. Maybe @gardar knows this stuff better. |
Something like But perhaps |
Fixes an issue with the jinja2 snippet which is used to create the node_exporter Systemd unit. More details here: #13 Jinja2 namespaces are used to ensure the variable `protect_home` can be set in the parent scope of the `for` loop looking through the mounts. Signed-off-by: Kevin Bowrin <[email protected]>
I've added a simple test (thanks @gardar for pointing out systemd_properties), but it's only half-baked. I'm not sure where to hook into the molecule tests to have different filesystems mounted under /home or at /home. |
Trying out some test changes here: #101 |
Fixes an issue with the jinja2 snippet which is used to create the node_exporter Systemd unit. More details here: #13
Jinja2 namespaces are used to ensure the variable
protect_home
can be set in the parent scope of thefor
loop looking through the mounts.