Reduces the permissions granted to the salt user used to run the
salt-master:
* Under /etc/salt limit ownership to /etc/salt/pki/master and
/etc/salt/master.d
* Until #64219 is resolved also include /etc/salt/minion.d
* Under /var/cache/salt and /var/run/salt only give ownership on
master directories
* Under /var/log/salt, ensure /var/log/salt/master exists and give
ownership oof that. Also update logrotate config to create that with
correct ownership and perms and install that on debian packages.
Updates Debian and RPM packages so that /opt/saltstack/salt and the
python packages don't have to be owned by salt user.
It shouldn't be necessary for salt user, used to run salt-master to be
able to write/modify files in that directory hierarchy.
Add postinst scripts to call the python compileall module to create
byte-compiled python modules. This should preserve performance whilst
not requiring write access for salt user.
Also cleans up .pyc files and __pycache__ dirs on removal.