Skip to content

Instantly share code, notes, and snippets.

@singingwolfboy
Last active October 13, 2015 04:28
Show Gist options
  • Save singingwolfboy/4139822 to your computer and use it in GitHub Desktop.
Save singingwolfboy/4139822 to your computer and use it in GitHub Desktop.
set salt config and log dir to live under Homebrew
diff --git a/salt/client.py b/salt/client.py
index cd8aacf..38f8857 100644
--- a/salt/client.py
+++ b/salt/client.py
@@ -69,7 +69,7 @@ class LocalClient(object):
'''
Connect to the salt master via the local server and via root
'''
- def __init__(self, c_path='/etc/salt/master', mopts=None):
+ def __init__(self, c_path='HOMEBREW_PREFIX/etc/salt/master', mopts=None):
if mopts:
self.opts - mopts
else:
diff --git a/salt/config.py b/salt/config.py
index fe3a076..e9e8ea1 100644
--- a/salt/config.py
+++ b/salt/config.py
@@ -177,7 +177,7 @@ def minion_config(path, check_dns=True):
'master_finger': '',
'user': 'root',
'root_dir': '/',
- 'pki_dir': '/etc/salt/pki/minion',
+ 'pki_dir': 'HOMEBREW_PREFIX/etc/salt/pki/minion',
'id': socket.getfqdn(),
'cachedir': '/var/cache/salt/minion',
'cache_jobs': False,
@@ -331,7 +331,7 @@ def master_config(path):
'timeout': 5,
'keep_jobs': 24,
'root_dir': '/',
- 'pki_dir': '/etc/salt/pki/master',
+ 'pki_dir': 'HOMEBREW_PREFIX/etc/salt/pki/master',
'cachedir': '/var/cache/salt/master',
'file_roots': {
'base': ['/srv/salt'],
diff --git a/salt/utils/parsers.py b/salt/utils/parsers.py
index 6c7df9f..0739ef1 100644
--- a/salt/utils/parsers.py
+++ b/salt/utils/parsers.py
@@ -174,7 +174,7 @@ class ConfigDirMixIn(DeprecatedConfigMessage):
def _mixin_setup(self):
self.add_option(
- '-c', '--config-dir', default='/etc/salt',
+ '-c', '--config-dir', default='HOMEBREW_PREFIX/etc/salt',
help=('Pass in an alternative configuration directory. Default: '
'%default')
)
@Lendar
Copy link

Lendar commented Dec 25, 2012

I like this patch (and homebrew-saltstack), but there are few mistakes. brew.py shouldn't be patched at all. There is also room for improvement: sock_dir could be patched as well.

P.S.: I've just reviewed all forks of https://github.com/singingwolfboy/homebrew-saltstack. Each of them is broken in some way (virtualenv, default paths, typos). Formula is good, we just need to polish it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment