Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

salt(cask): Add HOME env variable to plist files #94

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 13 additions & 22 deletions Casks/salt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

url "https://repo.saltproject.io/salt/py3/macos/minor/#{version}/salt-#{version}-py3-#{arch}.pkg"
name "Salt"
desc "World's fastest, most intelligent and scalable automation engine"
desc "Automation and infrastructure management engine"
homepage "https://saltproject.io/"

livecheck do
url "https://repo.saltproject.io/salt/py3/macos/latest"
regex(/salt-(\d+(?:\.\d+)?(?:-\d+)?)-py3-#{arch}\.pkg/)
regex(/salt[._-]v?(\d+(?:\.\d+)+)-py3-#{arch}\.pkg/)
end

conflicts_with formula: "salt"
Expand All @@ -30,6 +30,7 @@

xml["EnvironmentVariables"] = {} unless xml.key?("EnvironmentVariables")
xml["EnvironmentVariables"]["HOMEBREW_PREFIX"] = HOMEBREW_PREFIX.to_s
xml["EnvironmentVariables"]["HOME"] ||= "/var/root"

path = xml["EnvironmentVariables"]["PATH"] || "/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
path = "#{HOMEBREW_PREFIX}/bin:#{path}" unless path.split(":").include?("#{HOMEBREW_PREFIX}/bin")
Expand All @@ -49,36 +50,26 @@
end
end

uninstall pkgutil: [
"com.saltstack.salt",
],
launchctl: [
uninstall launchctl: [
"com.saltstack.salt.api",
"com.saltstack.salt.master",
"com.saltstack.salt.minion",
"com.saltstack.salt.syndic",
],
pkgutil: [
"com.saltstack.salt",
]

zap trash: [
"/etc/salt",
]
zap trash: "/etc/salt"

def caveats
<<~CAVEATS
After installation, configure the Salt minion ID, and the Salt master location,
replacing the placeholder text with custom information:

sudo salt-config -i [MINION_ID] -m [SALT_MASTER_HOST]

See Configure the Salt master and minions for more configuration options:
https://docs.saltproject.io/salt/install-guide/en/latest/topics/configure-master-minion.html

Load services you need:
Included services:

sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.api
sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.master
sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.minion
sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.syndic
sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.api.plist
sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.master.plist
sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.minion.plist
sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.syndic.plist
CAVEATS
end
end
Loading