mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
added salt/config.py, setup.py changes
This commit is contained in:
parent
7f30955675
commit
94a8b927de
4 changed files with 18 additions and 7 deletions
|
@ -1,3 +1,4 @@
|
|||
# DO NOT MODIFY THIS FILE. Copy it to: /etc/salt/master
|
||||
##### Primary configuration settings #####
|
||||
##########################################
|
||||
# The address of the interface to bind to
|
||||
|
@ -85,9 +86,9 @@
|
|||
# prod:
|
||||
# - /srv/salt/prod/services
|
||||
# - /srv/salt/prod/states
|
||||
#
|
||||
#
|
||||
# Default:
|
||||
#file_roots:
|
||||
#file_roots:
|
||||
# base:
|
||||
# - /srv/salt
|
||||
|
||||
|
@ -183,7 +184,7 @@
|
|||
##########################################
|
||||
# Node groups allow for logical groupings of minion nodes.
|
||||
# A group consists of a group name and a compound target.
|
||||
#
|
||||
#
|
||||
# nodegroups:
|
||||
# group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com and bl*.domain.com',
|
||||
# group2: 'G@os:Debian and foo.domain.com',
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# DO NOT MODIFY THIS FILE. Copy it to: /etc/salt/minion
|
||||
##### Primary configuration settings #####
|
||||
##########################################
|
||||
# Set the location of the salt master server, if the master server cannot be
|
||||
|
|
|
@ -30,7 +30,16 @@ def load_config(opts, path, env_var):
|
|||
'''
|
||||
|
||||
if not path or not os.path.isfile(path):
|
||||
path = os.environ.get(env_var, '')
|
||||
path = os.environ.get(env_var, path)
|
||||
# If the configuration file is missing, attempt to copy the template,
|
||||
# after removing the first header line.
|
||||
if not os.path.isfile(path):
|
||||
template = "%s.template" % path
|
||||
if os.path.isfile(template):
|
||||
with open(path, 'w') as out:
|
||||
with open(template, 'r') as f:
|
||||
f.readline() # skip first line
|
||||
out.write(f.read())
|
||||
|
||||
if os.path.isfile(path):
|
||||
try:
|
||||
|
@ -112,7 +121,7 @@ def minion_config(path):
|
|||
|
||||
# set up the extension_modules location from the cachedir
|
||||
opts['extension_modules'] = os.path.join(opts['cachedir'], 'extmods')
|
||||
|
||||
|
||||
return opts
|
||||
|
||||
|
||||
|
|
4
setup.py
4
setup.py
|
@ -122,8 +122,8 @@ setup(
|
|||
'scripts/salt-run',
|
||||
'scripts/salt'],
|
||||
data_files=[(os.path.join(etc_path, 'salt'),
|
||||
['conf/master',
|
||||
'conf/minion',
|
||||
['conf/master.template',
|
||||
'conf/minion.template',
|
||||
]),
|
||||
('share/man/man1',
|
||||
['doc/man/salt-master.1',
|
||||
|
|
Loading…
Add table
Reference in a new issue