mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
update macports doc, portfile
This commit is contained in:
parent
218c67e54e
commit
1e9e70720f
2 changed files with 15 additions and 138 deletions
|
@ -33,10 +33,25 @@ It should be noted that Homebrew explicitly discourages the `use of sudo`_:
|
|||
Installation from MacPorts
|
||||
==========================
|
||||
|
||||
Macports isolates its dependencies from the OS, and installs salt in /opt/local by default, with config files under /opt/local/etc/salt. For best results, add /opt/local/bin to your PATH.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo port install salt
|
||||
|
||||
Variants allow selection of python version used to run salt, defaulting to python27, but also supporting python34, python35, and python36. To install salt with Python 3.6, use the python36 variant, for example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo port install salt @python36
|
||||
|
||||
Startup items (for master, minion, and rest-cherrypy API gateway, respectively) are installed by subport targets. These will register launchd LaunchDaemons as org.macports.salt-minion, for example, to trigger automatic startup of the salt-minion through launchd. LaunchDaemons for salt can be started and stopped without reboot using the macprots load and unload commands.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo port install salt-master salt-minion salt-api
|
||||
sudo port load salt-master salt-minion salt-api
|
||||
|
||||
Installation from Pip
|
||||
=====================
|
||||
When only using the macOS system's pip, install this way:
|
||||
|
|
|
@ -1,138 +0,0 @@
|
|||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||
# $Id: Portfile 152295 2016-09-02 22:14:33Z larryv@macports.org $
|
||||
|
||||
PortSystem 1.0
|
||||
PortGroup github 1.0
|
||||
PortGroup python 1.0
|
||||
|
||||
github.setup saltstack salt 2016.11 v
|
||||
name salt
|
||||
categories sysutils
|
||||
platforms darwin
|
||||
maintainers gmail.com:jeremy.mcmillan
|
||||
license Apache-2
|
||||
supported_archs noarch
|
||||
|
||||
description Salt is a Python-based remote execution, automation, \
|
||||
configuration, and orchestration engine.
|
||||
|
||||
long_description SaltStack is fast, scalable and flexible software for data \
|
||||
center automation, from infrastructure and any cloud, \
|
||||
to the entire application stack.
|
||||
|
||||
homepage http://saltstack.com/
|
||||
|
||||
python.default_version 27
|
||||
|
||||
checksums rmd160 ad958f0c1a1bb0656ce401e06533a5f60b43fe72 \
|
||||
sha256 d277570404bdd53bc883847f1ebdd2686d1b23f428ceb735006d2cddc5b15b79
|
||||
|
||||
depends_build port:py${python.version}-setuptools
|
||||
|
||||
depends_lib-append port:py${python.version}-crypto \
|
||||
port:py${python.version}-jinja2 \
|
||||
port:py${python.version}-msgpack \
|
||||
port:py${python.version}-pip \
|
||||
port:py${python.version}-yaml \
|
||||
port:py${python.version}-tornado \
|
||||
port:py${python.version}-zmq \
|
||||
port:swig-python
|
||||
|
||||
startupitem.create yes
|
||||
startupitem.name salt-minion
|
||||
startupitem.netchange yes
|
||||
startupitem.logevents yes
|
||||
startupitem.logfile ${prefix}/var/log/salt/minion
|
||||
startupitem.executable ${prefix}/bin/salt-minion
|
||||
|
||||
|
||||
|
||||
post-activate {
|
||||
|
||||
file mkdir ${prefix}/etc/salt
|
||||
|
||||
if ![file exists /etc/salt] {
|
||||
ln -s ${prefix}/etc/salt /etc/salt
|
||||
}
|
||||
|
||||
if ![file exists ${prefix}/etc/salt/minion] {
|
||||
copy ${worksrcpath}/conf/minion ${prefix}/etc/salt
|
||||
}
|
||||
|
||||
if ![file exists ${prefix}/etc/salt/master] {
|
||||
copy ${worksrcpath}/conf/master ${prefix}/etc/salt
|
||||
}
|
||||
}
|
||||
|
||||
post-destroot {
|
||||
|
||||
if ![file exists ${destroot}/Library/LaunchDaemons] {
|
||||
file mkdir ${destroot}/Library/LaunchDaemons
|
||||
}
|
||||
copy ${worksrcpath}/pkg/osx/scripts/com.saltstack.salt.master.plist \
|
||||
${destroot}/Library/LaunchDaemons/org.macports.salt-master.plist
|
||||
reinplace -W ${destroot}/Library/LaunchDaemons \
|
||||
"s|/opt/salt/bin/start-salt-master.sh|${prefix}/bin/salt-master|g" org.macports.salt-master.plist
|
||||
reinplace -W ${destroot}/Library/LaunchDaemons \
|
||||
"s|com.saltstack.salt.master|org.macports.salt-master|g" org.macports.salt-master.plist
|
||||
copy ${worksrcpath}/pkg/osx/scripts/com.saltstack.salt.api.plist \
|
||||
${destroot}/Library/LaunchDaemons/org.macports.salt-api.plist
|
||||
reinplace -W ${destroot}/Library/LaunchDaemons \
|
||||
"s|/opt/salt/bin/start-salt-api.sh|${prefix}/bin/salt-api|g" org.macports.salt-api.plist
|
||||
reinplace -W ${destroot}/Library/LaunchDaemons \
|
||||
"s|com.saltstack.salt.api|org.macports.salt-api|g" org.macports.salt-api.plist
|
||||
copy ${worksrcpath}/pkg/osx/scripts/com.saltstack.salt.syndic.plist \
|
||||
${destroot}/Library/LaunchDaemons/org.macports.salt-syndic.plist
|
||||
reinplace -W ${destroot}/Library/LaunchDaemons \
|
||||
"s|/opt/salt/bin/start-salt-syndic.sh|${prefix}/bin/salt-syndic|g" org.macports.salt-syndic.plist
|
||||
reinplace -W ${destroot}/Library/LaunchDaemons \
|
||||
"s|com.saltstack.salt.syndic|org.macports.salt-syndic|g" org.macports.salt-syndic.plist
|
||||
|
||||
}
|
||||
|
||||
pre-deactivate {
|
||||
|
||||
if { [file type /etc/salt] == "link" } {
|
||||
file delete /etc/salt
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
notes "
|
||||
This port configures a LaunchItem for salt-minion.
|
||||
|
||||
It also installs LaunchItems for the salt-master, api, and the salt-syndic.
|
||||
|
||||
To start the salt-master, api, or syndic via launchd, run
|
||||
|
||||
sudo launchctl load -w /Library/LaunchDaemons/org.macports.salt-master.plist
|
||||
sudo launchctl load -w /Library/LaunchDaemons/org.macports.salt-api.plist
|
||||
sudo launchctl load -w /Library/LaunchDaemons/org.macports.salt-syndic.plist
|
||||
|
||||
or to start on El Capitan (10.11) or later system
|
||||
|
||||
sudo launchctl enable system/org.macports.salt-master
|
||||
sudo launchctl bootstrap system /Library/LaunchDaemons/org.macports.salt-master.plist
|
||||
sudo launchctl enable system/org.macports.salt-api
|
||||
sudo launchctl bootstrap system /Library/LaunchDaemons/org.macports.salt-api.plist
|
||||
sudo launchctl enable system/org.macports.salt-syndic
|
||||
sudo launchctl bootstrap system /Library/LaunchDaemons/org.macports.salt-syndic.plist
|
||||
|
||||
To disable launchd management for the master or syndic, run the appropriate
|
||||
unload command:
|
||||
|
||||
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.salt-master.plist
|
||||
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.salt-api.plist
|
||||
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.salt-syndic.plist
|
||||
|
||||
or to disable on El Capitan (10.11) or later system
|
||||
|
||||
sudo launchctl disable system/org.macports.salt-master
|
||||
sudo launchctl bootout system /Library/LaunchDaemons/org.macports.salt-master.plist
|
||||
sudo launchctl disable system/org.macports.salt-api
|
||||
sudo launchctl bootout system /Library/LaunchDaemons/org.macports.salt-api.plist
|
||||
sudo launchctl disable system/org.macports.salt-syndic
|
||||
sudo launchctl bootout system /Library/LaunchDaemons/org.macports.salt-syndic.plist
|
||||
|
||||
"
|
||||
|
Loading…
Add table
Reference in a new issue