Skip to content

Commit

Permalink
Generate master and minion configs
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz authored and s0undt3ch committed May 3, 2023
1 parent 358cadb commit c1214d1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
9 changes: 9 additions & 0 deletions pkg/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ override_dh_auto_build:

build/onedir/venv/bin/tools pkg build salt-onedir . --package-name build/onedir/salt --platform linux
build/onedir/venv/bin/tools pkg pre-archive-cleanup --pkg build/onedir/salt

else
override_dh_auto_build:
# The relenv onedir is being provided, all setup up until Salt is installed
Expand All @@ -38,6 +39,7 @@ override_dh_auto_build:

# Fix any hardcoded paths to the relenv python binary on any of the scripts installed in the <onedir>/bin directory
find build/onedir/salt/bin/ -type f -exec sed -i 's:#!/\(.*\)salt/bin/python3:#!/bin/sh\n"exec" "$$(dirname $$(readlink -f $$0))/python3" "$$0" "$$@":g' {} \;

endif

# dh_auto_install tries to invoke distutils causing failures.
Expand All @@ -47,4 +49,11 @@ override_dh_auto_install:
override_dh_install:
mkdir -p debian/salt-common/opt/saltstack
cp -R build/onedir/salt debian/salt-common/opt/saltstack/

# Generate master and minion configs
mkdir -p debian/salt-master/etc/salt
sed 's/#user: root/user: salt/g' conf/master > debian/salt-master/etc/salt/master
mkdir -p debian/salt-minion/etc/salt
sed 's/#user: root/#user: root\ngroup: salt/g' conf/minion > debian/salt-minion/etc/salt/minion

dh_install
1 change: 0 additions & 1 deletion pkg/debian/salt-master.install
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
pkg/common/conf/master /etc/salt
pkg/common/salt-master.service /lib/systemd/system
1 change: 0 additions & 1 deletion pkg/debian/salt-minion.install
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
conf/minion /etc/salt
conf/proxy /etc/salt
pkg/common/salt-minion.service /lib/systemd/system
pkg/common/[email protected] /lib/systemd/system
4 changes: 2 additions & 2 deletions pkg/rpm/salt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ cd $RPM_BUILD_DIR

# Generate master and minion configs
sed 's/#user: root/user: salt/g' %{_salt_src}/conf/master > $RPM_BUILD_DIR/build/master
sed 's/#group: root/group: salt/g' %{_salt_src}/conf/minion > $RPM_BUILD_DIR/build/minion
sed 's/#group: root/#user: root\ngroup: salt/g' %{_salt_src}/conf/minion > $RPM_BUILD_DIR/build/minion

%else
# The relenv onedir is being provided, all setup up until Salt is installed
Expand All @@ -166,7 +166,7 @@ cd $RPM_BUILD_DIR

# Generate master and minion configs
sed 's/#user: root/user: salt/g' %{_salt_src}/conf/master > $RPM_BUILD_DIR/build/master
sed 's/#group: root/group: salt/g' %{_salt_src}/conf/minion > $RPM_BUILD_DIR/build/minion
sed 's/#group: root/#user: root\ngroup: salt/g' %{_salt_src}/conf/minion > $RPM_BUILD_DIR/build/minion

cd $RPM_BUILD_DIR
%endif
Expand Down

0 comments on commit c1214d1

Please sign in to comment.