Date: Sun, 27 Sep 2015 14:32:05 +0000 (UTC) From: Jason Unovitch <junovitch@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r398042 - in head/sysutils/py-salt: . files Message-ID: <201509271432.t8REW5Ri020138@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: junovitch Date: Sun Sep 27 14:32:04 2015 New Revision: 398042 URL: https://svnweb.freebsd.org/changeset/ports/398042 Log: 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) Added: head/sysutils/py-salt/files/salt_proxy.in (contents, props changed) Modified: head/sysutils/py-salt/Makefile head/sysutils/py-salt/files/pkg-message.in head/sysutils/py-salt/files/salt_api.in head/sysutils/py-salt/files/salt_master.in head/sysutils/py-salt/files/salt_minion.in head/sysutils/py-salt/files/salt_syndic.in Modified: head/sysutils/py-salt/Makefile ============================================================================== --- head/sysutils/py-salt/Makefile Sun Sep 27 14:27:06 2015 (r398041) +++ head/sysutils/py-salt/Makefile Sun Sep 27 14:32:04 2015 (r398042) @@ -3,6 +3,7 @@ PORTNAME= salt PORTVERSION= 2015.8.0 +PORTREVISION= 1 CATEGORIES= sysutils python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -56,7 +57,9 @@ PYDISTUTILS_INSTALLARGS+=\ --salt-logs-dir=/var/log/salt \ --salt-pidfile-dir=/var/run -USE_RC_SUBR= salt_master \ +USE_RC_SUBR= salt_api \ + salt_proxy \ + salt_master \ salt_minion \ salt_syndic Modified: head/sysutils/py-salt/files/pkg-message.in ============================================================================== --- head/sysutils/py-salt/files/pkg-message.in Sun Sep 27 14:27:06 2015 (r398041) +++ head/sysutils/py-salt/files/pkg-message.in Sun Sep 27 14:32:04 2015 (r398042) @@ -15,5 +15,13 @@ To configure a Salt Minion, do the follo 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) + =================================================================================================== Modified: head/sysutils/py-salt/files/salt_api.in ============================================================================== --- head/sysutils/py-salt/files/salt_api.in Sun Sep 27 14:27:06 2015 (r398041) +++ head/sysutils/py-salt/files/salt_api.in Sun Sep 27 14:32:04 2015 (r398042) @@ -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%%" Modified: head/sysutils/py-salt/files/salt_master.in ============================================================================== --- head/sysutils/py-salt/files/salt_master.in Sun Sep 27 14:27:06 2015 (r398041) +++ head/sysutils/py-salt/files/salt_master.in Sun Sep 27 14:32:04 2015 (r398042) @@ -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" Modified: head/sysutils/py-salt/files/salt_minion.in ============================================================================== --- head/sysutils/py-salt/files/salt_minion.in Sun Sep 27 14:27:06 2015 (r398041) +++ head/sysutils/py-salt/files/salt_minion.in Sun Sep 27 14:32:04 2015 (r398042) @@ -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%%" Added: head/sysutils/py-salt/files/salt_proxy.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/py-salt/files/salt_proxy.in Sun Sep 27 14:32:04 2015 (r398042) @@ -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" Modified: head/sysutils/py-salt/files/salt_syndic.in ============================================================================== --- head/sysutils/py-salt/files/salt_syndic.in Sun Sep 27 14:27:06 2015 (r398041) +++ head/sysutils/py-salt/files/salt_syndic.in Sun Sep 27 14:32:04 2015 (r398042) @@ -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%%"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509271432.t8REW5Ri020138>