summaryrefslogtreecommitdiff
path: root/sysutils/py-salt/files
diff options
context:
space:
mode:
authorJason Unovitch <junovitch@FreeBSD.org>2015-09-27 14:32:04 +0000
committerJason Unovitch <junovitch@FreeBSD.org>2015-09-27 14:32:04 +0000
commit46cc6a938dabaa4e79aecfd727903be2110186db (patch)
tree7645269f7d3582c9ce1898c640521551dc90e055 /sysutils/py-salt/files
parent- Update to 1.1.0 (diff)
sysutils/py-salt: add new rc scripts, clean up current scripts
- Add salt-proxy.in and associated pkg-message text for Salt Proxy - Restore installation of salt-api.in accidentally removed in r396791 - Set a default for PATH to address upstream issue 27151 - While here, make headers more verbose and trim variable quotes per rclint PR: 203262 Submitted by: Christer Edwards <christer.edwards@gmail.com> (maintainer)
Notes
Notes: svn path=/head/; revision=398042
Diffstat (limited to 'sysutils/py-salt/files')
-rw-r--r--sysutils/py-salt/files/pkg-message.in8
-rw-r--r--sysutils/py-salt/files/salt_api.in7
-rw-r--r--sysutils/py-salt/files/salt_master.in16
-rw-r--r--sysutils/py-salt/files/salt_minion.in15
-rw-r--r--sysutils/py-salt/files/salt_proxy.in59
-rw-r--r--sysutils/py-salt/files/salt_syndic.in7
6 files changed, 98 insertions, 14 deletions
diff --git a/sysutils/py-salt/files/pkg-message.in b/sysutils/py-salt/files/pkg-message.in
index 8888f5dede90..47459fb67a78 100644
--- a/sysutils/py-salt/files/pkg-message.in
+++ b/sysutils/py-salt/files/pkg-message.in
@@ -15,5 +15,13 @@ To configure a Salt Minion, do the following:
o Update 'master: salt' to point to your Salt Master's hostname or IP
o sysrc salt_minion_enable="YES"
+---------------------------------------------------------------------------------------------------
+
+To configure a Salt Proxy Minion, do the following:
+
+ o sysrc salt_proxy_enable="YES"
+ o sysrc salt_proxy_list=""
+ o Update the salt_proxy_list with the proxy minion name(s)
+
===================================================================================================
diff --git a/sysutils/py-salt/files/salt_api.in b/sysutils/py-salt/files/salt_api.in
index 79e04b34f42f..a5c01ea7c33e 100644
--- a/sysutils/py-salt/files/salt_api.in
+++ b/sysutils/py-salt/files/salt_api.in
@@ -10,17 +10,18 @@
# Add the following to /etc/rc.conf[.local] to enable this service
#
-# salt_api_enable="YES"
+# salt_api_enable (bool): Set to NO by default.
+# Set it to YES to enable salt_api
#
. /etc/rc.subr
-name="salt_api"
+name=salt_api
rcvar=salt_api_enable
load_rc_config ${name}
-: ${salt_api_enable:="NO"}
+: ${salt_api_enable:=NO}
command="%%PREFIX%%/bin/salt-api"
command_interpreter="%%PYTHON_CMD%%"
diff --git a/sysutils/py-salt/files/salt_master.in b/sysutils/py-salt/files/salt_master.in
index 8cf242c5e51c..5f9181a435aa 100644
--- a/sysutils/py-salt/files/salt_master.in
+++ b/sysutils/py-salt/files/salt_master.in
@@ -10,21 +10,31 @@
# Add the following to /etc/rc.conf[.local] to enable this service
#
-# salt_master_enable="YES"
+# salt_master_enable (bool): Set to NO by default.
+# Set it to YES to enable salt_master.
+# salt_master_paths (string): Set to "/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/bin:%%PREFIX%%/sbin" by default.
+# Default $PATH for salt_master.
+# salt_master_eggcache (string): Set to "/tmp" by default.
+# Allows defining egg cache directory to fix runtime on diskless systems.
#
. /etc/rc.subr
-name="salt_master"
+name=salt_master
rcvar=salt_master_enable
load_rc_config ${name}
-: ${salt_master_enable:="NO"}
+: ${salt_master_enable:=NO}
+: ${salt_master_paths=/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/bin:%%PREFIX%%/sbin}
+: ${salt_master_eggcache=/tmp}
command="%%PREFIX%%/bin/salt-master"
command_interpreter="%%PYTHON_CMD%%"
required_files="%%PREFIX%%/etc/salt"
command_args="-c ${required_files} -d"
+export PATH="${salt_master_paths}"
+export PYTHON_EGG_CACHE="${salt_master_eggcache}"
+
run_rc_command "$1"
diff --git a/sysutils/py-salt/files/salt_minion.in b/sysutils/py-salt/files/salt_minion.in
index b9366910fae8..189fbd8d5427 100644
--- a/sysutils/py-salt/files/salt_minion.in
+++ b/sysutils/py-salt/files/salt_minion.in
@@ -10,19 +10,24 @@
# Add the following to /etc/rc.conf[.local] to enable this service
#
-# salt_minion_enable="YES"
+# salt_minion_enable (bool): Set to NO by default.
+# Set it to YES to enable salt_minion
+# salt_minion_paths (string): Set to "/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/bin:%%PREFIX%%/sbin" by default.
+# Default $PATH for salt_minion
+# salt_minion_eggcache (string): Set to "/tmp" by default.
+# Allows defining egg cache directory to fix runtime on diskless systems.
#
. /etc/rc.subr
-name="salt_minion"
+name=salt_minion
rcvar=salt_minion_enable
load_rc_config ${name}
-: ${salt_minion_enable:="NO"}
-: ${salt_minion_paths="$PATH"}
-: ${salt_minion_eggcache="/tmp"}
+: ${salt_minion_enable:=NO}
+: ${salt_minion_paths=/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/bin:%%PREFIX%%/sbin}
+: ${salt_minion_eggcache=/tmp}
command="%%PREFIX%%/bin/salt-minion"
command_interpreter="%%PYTHON_CMD%%"
diff --git a/sysutils/py-salt/files/salt_proxy.in b/sysutils/py-salt/files/salt_proxy.in
new file mode 100644
index 000000000000..2fd66ec9c844
--- /dev/null
+++ b/sysutils/py-salt/files/salt_proxy.in
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# Salt Proxy startup script
+#
+# PROVIDE: salt_proxy
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following to /etc/rc.conf[.local] to enable this service
+#
+# salt_proxy_enable (bool): Set to NO by default.
+# Set it to YES to enable salt_proxy.
+# salt_proxy_paths (string): Set to "/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/bin:%%PREFIX%%/sbin" by default.
+# Default $PATH for Salt
+# salt_proxy_eggcache (string): Set to "/tmp" by default.
+# Allows defining egg cache directory to fix runtime on diskless systems.
+# salt_proxy_list (string): Set to "" by default.
+# Space separated list of proxies.
+#
+
+. /etc/rc.subr
+
+name=salt_proxy
+rcvar=salt_proxy_enable
+
+load_rc_config ${name}
+
+: ${salt_proxy_enable:=NO}
+: ${salt_proxy_paths=/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/bin:%%PREFIX%%/sbin}
+: ${salt_proxy_eggcache=/tmp}
+
+start_cmd=salt_proxy_start
+
+command="%%PREFIX%%/bin/salt-proxy"
+command_interpreter="%%PYTHON_CMD%%"
+required_files="%%PREFIX%%/etc/salt"
+command_args="-c ${required_files} -d"
+
+export PATH="${salt_minion_paths}"
+export PYTHON_EGG_CACHE="${salt_minion_eggcache}"
+
+salt_proxy_start()
+{
+ if [ ! -n "${salt_proxy_list}" ]; then
+ echo "${salt_proxy_list} is undefined"
+ return 1
+ fi
+
+ local _proxy
+
+ for _proxy in ${salt_proxy_list}; do
+ echo "Starting salt-proxy: ${_proxy}"
+ ${command_interpreter} ${command} --proxyid ${_proxy} ${command_args}
+ done
+}
+
+run_rc_command "$1"
diff --git a/sysutils/py-salt/files/salt_syndic.in b/sysutils/py-salt/files/salt_syndic.in
index 078778f45816..004d67f97914 100644
--- a/sysutils/py-salt/files/salt_syndic.in
+++ b/sysutils/py-salt/files/salt_syndic.in
@@ -10,17 +10,18 @@
# Add the following to /etc/rc.conf[.local] to enable this service
#
-# salt_syndic_enable="YES"
+# salt_syndic_enable (bool): Set to NO by default.
+# Set it to YES to enable salt_syndic
#
. /etc/rc.subr
-name="salt_syndic"
+name=salt_syndic
rcvar=salt_syndic_enable
load_rc_config ${name}
-: ${salt_syndic_enable:="NO"}
+: ${salt_syndic_enable:=NO}
command="%%PREFIX%%/bin/salt-syndic"
command_interpreter="%%PYTHON_CMD%%"