mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Fix perms on could deployment directories
This commit is contained in:
parent
3365a55c56
commit
c4ee9ee967
3 changed files with 25 additions and 0 deletions
5
pkg/debian/salt-cloud.postinst
Normal file
5
pkg/debian/salt-cloud.postinst
Normal file
|
@ -0,0 +1,5 @@
|
|||
case "$1" in
|
||||
configure)
|
||||
chown -R salt:salt /etc/salt/cloud.deploy.d /opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/deploy
|
||||
;;
|
||||
esac
|
|
@ -415,6 +415,8 @@ ln -s -f /opt/saltstack/salt/salt-pip %{_bindir}/salt-pip
|
|||
|
||||
|
||||
%post cloud
|
||||
chown -R salt:salt /etc/salt/cloud.deploy.d
|
||||
chown -R salt:salt /opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/deploy
|
||||
ln -s -f /opt/saltstack/salt/salt-cloud %{_bindir}/salt-cloud
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import pathlib
|
||||
import subprocess
|
||||
|
||||
import psutil
|
||||
|
@ -53,3 +54,20 @@ def test_salt_user_group(install_salt):
|
|||
except:
|
||||
pass
|
||||
assert in_group is True
|
||||
|
||||
|
||||
def test_salt_cloud_dirs(install_salt):
|
||||
"""
|
||||
Test the correct user is running the Salt Master
|
||||
"""
|
||||
if platform.is_windows() or platform.is_darwin():
|
||||
pytest.skip("Package does not have user set. Not testing user")
|
||||
paths = [
|
||||
"/opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/deploy",
|
||||
"/etc/salt/cloud.deploy.d",
|
||||
]
|
||||
for name in paths:
|
||||
path = pathlib.Path(name)
|
||||
assert path.exists()
|
||||
assert path.owner() == "salt"
|
||||
assert path.group() == "salt"
|
||||
|
|
Loading…
Add table
Reference in a new issue