lfops
lfops copied to clipboard
role:monitoring_plugins: Make it faster when deploying MP from source
Not idempotent, but much faster would be to use a pure shell command on localhost and do something like this (pseudo-code):
rsync --archive --rsync-path='sudo rsync' path/to/lib/*.py $target:/usr/lib64/nagios/plugins/lib/
for plugin in plugins:
rsync --archive --rsync-path='sudo rsync' path/to/monitoring-plugins/check-plugins/$plugin/$plugin $target:/usr/lib64/nagios/plugins/
}
sudo /usr/sbin/restorecon -r /usr/lib64/nagios/plugins
Would just run a few seconds or so (instead of up to 500 seconds as of now). What do you think?