Skip to content

Commit

Permalink
Handle creation of /var/log/salt/key
Browse files Browse the repository at this point in the history
  • Loading branch information
barneysowood authored and garethgreenaway committed Aug 16, 2023
1 parent 94adcd1 commit 5d3ffc9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/common/salt-common.logrotate
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
rotate 7
compress
notifempty
create 0640 salt salt
}

/var/log/salt/api {
Expand Down
6 changes: 5 additions & 1 deletion pkg/debian/salt-master.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ case "$1" in
touch /var/log/salt/master
chmod 640 /var/log/salt/master
fi
chown -R salt:salt /etc/salt/pki/master /etc/salt/master.d /etc/salt/minion.d /var/log/salt/master /var/cache/salt/master /var/run/salt/master
if [ ! -e "/var/log/salt/key" ]; then
touch /var/log/salt/key
chmod 640 /var/log/salt/key
fi
chown -R salt:salt /etc/salt/pki/master /etc/salt/master.d /etc/salt/minion.d /var/log/salt/master /var/log/salt/key /var/cache/salt/master /var/run/salt/master
if command -v systemctl; then systemctl enable salt-master; fi
;;
esac
6 changes: 5 additions & 1 deletion pkg/rpm/salt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,11 @@ if [ ! -e "/var/log/salt/master" ]; then
touch /var/log/salt/master
chmod 640 /var/log/salt/master
fi
chown -R %{_SALT_USER}:%{_SALT_GROUP} /etc/salt/pki/master /etc/salt/master.d /var/log/salt/master /var/cache/salt/master /var/run/salt/master
if [ ! -e "/var/log/salt/key" ]; then
touch /var/log/salt/key
chmod 640 /var/log/salt/key
fi
chown -R %{_SALT_USER}:%{_SALT_GROUP} /etc/salt/pki/master /etc/salt/master.d /var/log/salt/master /var/log/salt/key /var/cache/salt/master /var/run/salt/master


%posttrans api
Expand Down

0 comments on commit 5d3ffc9

Please sign in to comment.