added salt/config.py, setup.py changes

This commit is contained in:
Jeff Bauer 2012-01-16 13:36:39 -06:00
parent 7f30955675
commit 94a8b927de
4 changed files with 18 additions and 7 deletions

View file

@ -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',

View file

@ -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

View file

@ -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

View file

@ -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',