saltstack-formulas / librenms-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
4 stars 9 forks source link

Speed up the formula #8

Closed alxwr closed 1 year ago

alxwr commented 5 years ago

Instead of file.directory with recurse: ['user', 'group'] the formula now uses chmod and chown when it is necessary. This prevents a highly reproducilbe Minion did not return. [No response]. :-)

Tested on FreeBSD 11.2.

vutny commented 5 years ago

I meant you still can use onchanges requisite to not invoke recursive operation on every Salt state run.

alxwr commented 5 years ago

@vutny Thanks for your review!

@alxwr I wonder, could we use file.directory state function with recurse parameter instead of raw chmod/chown commands?

recurse is extremely slow. Up to the point of "minion did not respond". (I was so glad when I figured out this was the bottleneck! :-)

The only OS (I can think of) where chown/chmod won't work is Windows. I'll wrap the code in if grains.os_family != 'Windows', but I doubt anyone would run LibreNMS on Windows. We could also enable chown/chmod only for Linux and FreeBSD and use recurse for the rest. (But that's not exactly DRY...)

I meant you still can use onchanges requisite to not invoke recursive operation on every Salt state run.

That won't solve the underlying problem. :-(

aboe76 commented 5 years ago

@alxwr if I look at the new installation manuals from https://docs.librenms.org/Installation/

they have abandoned the git clone method and started with composer, shouldn't that solve a lot of problems, running composer as librenms should fix the file permissions.

alxwr commented 5 years ago

@aboe76 I'll try that. Thanks!